I wonder if there is anyone that can make an action that uses/changes gold coins when the stack is 100. And the same with platinium coin. I need this of an OT.

I've tried useitem ('gold coin') wait 5000 and it works BUT only if the only thing I have is and 100 stack this does not work if I have one 100 stack and one stack with another number from 1-99.