I had come across this but didn't quite catch that but as you specifically suggested it, I tried it again.
It works in my use case.
I'll just have to make sure I set that variable AFTER the pause action or semaphore lock action for every macro.
And I'm going to use this. Thank you.