Skills and States Core VisuStella MZ - Passive State duration and removal triggers

Hello,
This should have been posted in plugin help.
Using Skills and States Core by VisuStella MZ, I created a passive state that activates when the actor MP reaches zero.
1760813200873.png

This of course works fine. The state in question is a "stun" type state, where the actor cannot move while MP is zero. Without an item, or MP recovery/turn, they will be stuck at zero and in the state forever. I know passive states are not governed by the default turn duration, and can't be removed manually without common events. You simply need to remove the condition that triggers the state. I don't want that, though. What I want to do is make the passive state have a set duration of x turns, and then a common event recovers the Actor MP, so that the state will be removed, only after x turns. I started with this, but I don't know how to instruct the event to count the turns. I also don't know if this is the best way, or if this idea is even possible within the Visustella plugin.
1760813413861.png


If anybody has any idea, that's much appreciated.
Hmmm, can't you use a normal stun state that lasts for X turns? Give the actors <JS Post-Apply as User> and <JS Post-Apply as Target> to check their mp. If their mp is 0 and they aren't affected by the state, add the state. If their mp is bigger than 0, remove the sate. Might also want to put a <JS Post-Regenerate> Then you can use <JS On Erase State> to give the actors some mp.

Original thread: https://forums.rpgmakerweb.com/threads/skills-and-states-core-visustella-mz-passive-state-duration-and-removal-triggers.180607/