Another way to approach it, is by using "wp_localize_script()" to create objects from php that you can access from anywhere.
//Get User ID
$user = wp_get_current_user();
$userID = $user->roles[0];
//Enqueue script
wp_register_script( 'script_handle', get_template_directory_uri() . '/js/custom.js', array( 'jquery' ), '', true );
// Localize the script with new data
$dataArray = array(
'userID' => $userID,
'anyother_value' => 'more data'
);
wp_localize_script( 'script_handle', 'object_name', $dataArray );
// Enqueued script with localized data.
wp_enqueue_script( 'script_handle' );
In your separate javascript file you can simply call the object like below.
Li.re( 'ab12', object_name.userID );
And your shortcode call is not working because ".$get_current_user_id." is not a variable but a function. The correct way is ".get_current_user_id().". And I think your calling it wrong. You need to create a new WP_user object.
<?php
$user = new WP_User(get_current_user_id());
$userID = $user->roles[0];
?>
<?php echo do_shortcode( '[mycred_link subid1="' . $userID . '"][/mycred_link]' ); ?>
Li.re( 'ab12', '<?php echo get_current_user_id(); ?>' );