Chance of state auto-removal on each turn

Hiya! I'm trying to create a state that has a 20% chance of auto-removing itself on each turn. One of the things I've tried was making a "State phase 1" and "State phase 2" system to do this, but I just can't figure it out. I don't know if that would work anyway.


Another thing I tried was-- knowing that states can't have damage formulas-- I tried to make a state activate a skill so I could use the skill's damage formula to execute a random chance at removing the state. However, states apparently can't use skills, so... *Sigh* Limitations, limitations.


But anyway. Anyone have any ideas?
Hmmm...the best idea I have on this one is to use the state auto remove at turn end, and set the turns to be a wide range. It won't be the same thing, but in terms of how long the state lasts you can math it out to be effectively the same number of states. For example, if you want the state to last on average 5 turns, you could probably use turn end 2 - 8 or something like that to effectively get the same result long term in terms of how long the state lasts.


Beyond that, no idea I'm afraid. I'm not even sure of a script solution for this one as I've never seen this one requested before. Will monitor though as I would be curious as to possible solutions too.
Hmmm...the best idea I have on this one is to use the state auto remove at turn end, and set the turns to be a wide range. It won't be the same thing, but in terms of how long the state lasts you can math it out to be effectively the same number of states. For example, if you want the state to last on average 5 turns, you could probably use turn end 2 - 8 or something like that to effectively get the same result long term in terms of how long the state lasts.


Beyond that, no idea I'm afraid. I'm not even sure of a script solution for this one as I've never seen this one requested before. Will monitor though as I would be curious as to possible solutions too.



Definitely not the same thing, but thanks for the suggestion. Still looking for a solution...


Update! I thought of something.


I want to clarify that the person who is in this state cannot move. So how about if I have somewhere in each skill's damage formula something like this?

Code:
if rand(100) < 20 a.remove_state(1);
if rand(100) < 20 b.remove_state(1);

That way whenever anyone uses a skill, there is a 20% chance of either person in that state having it removed?


Though if everyone is in this state, nobody can use a skill, and therefore the game is soft-locked...


Is there a way to perform a damage formula at the beginning of every turn of a battle, regardless of who does what? For Troop Battle Events, what does the condition "When the end of the turn" do?


-------------------------------


Second update! I got it working through Battle Events to give each actor and enemy a 20% chance of state removal. However, apparently state removal event commands don't activate the state removal message, which I find to be an absolutely ridiculous oversight in the program. Gonna look for a solution to that next!

Original thread: https://forums.rpgmakerweb.com/threads/chance-of-state-auto-removal-on-each-turn.60215/