When the program is executing inside a custom function, the sequencer doesn't get advanced at all since the ladder portion of the program can only continue execution after returning from the currently executed custom function.
But if you want to change a sequencer step # from within a custom function, you can simply assign
CTRPV[m] = n
where m=sequencer # (1-8) n = the step number (0-31)
E.g.
CTRPV[1] = 5 ' set sequencer #1 to step #5