Your variables are not in functions scope.
My example of function:
function customPagination($paged = '', $max_page="") {
global $wp_query;
$big = 999999999;
if( ! $paged )
$paged = get_query_var('paged');
if( ! $max_page )
$max_page = $wp_query->max_num_pages;
echo paginate_links( array(
'total' => $max_page,
'prev_next' => false,
'prev_text' => false,
'next_text' => false,
'total' => $wp_query->max_num_pages,
'mid_size' => 3
) );
}
and then calling it with your variables (just changed to camelCase)
customPagination($currentPage, $myQuery->max_num_pages);
Hope it helps