States Expire in a Set Time

Would it be possible to make the states expire after a certain amount of time has passed? For example if I were to apply a poison to the enemy, the state would expire in 20 seconds. Or if I were to use the Guard command, the character would be guarding 10 seconds, and then the state would vanish.
Edit: The player should be able to decide the amount of seconds each state would last.
A script like this would be needed for (mog's) active time battle system.
This is the wrong forum to post this question, yours is a script request.
Script support is for questions about already-existing scripts.

I've moved this thread to Script Requests. Thank you.



@Mawichan : Next time please report the post so we can move it. That way the moderators can see it.

Original thread: https://forums.rpgmakerweb.com/threads/states-expire-in-a-set-time.92504/