I think I know the answer:
Once you use a "wait" action, even if you used "wait 1 second", the function parameters will not be stored, so you will end up with "0" if you put "function.param(0)" after the wait action.
This is fixed in C3 I believe, where "wait" actions will still remember the parameters.
But yes, storing the value elsewhere like you said, is a fair workaround.