A status effect that restricts move, but chance-based

Hello,
I have been thinking about adding a new status effect to our game. It's called "Fearful" and it would work similar to the Stun status effect in that it causes the "Cannot move" restriction (i.e. an affected player character or enemy cannot do any action for any given turn if they are affected by Stun). The problem is that I want the game to essentially roll the dice against a percentage, say 50%, so before a turn starts the game checks if an affected character/enemy can actually doan action or not. If not, they are unselectable like with Stun's "cannot move".
Is this possible? If so, how would I go about this? Our game uses Yanfly Engine Ace's battle system, if that has any influences.
Thank you and have a nice day.
You could use a Troop event. Create a bunch of conditionals to check each participant in the battle for the state, and then on a random number force them to wait.
That's sadly not viable because we have hundreds of troops already.
https://yanflychannel.wordpress.com/rmvxa/utility-scripts/base-troop-events/ you only need to edit 1 troop here.
I'll try that, thank you.
Yeah. Conditional branches would work like making random numbers from 1~4 for a 25% chance.
I've tried it and found a way to make this work perfectly; the script is super useful. Thank you everyone for the help.
Thread closed

Original thread: https://forums.rpgmakerweb.com/threads/a-status-effect-that-restricts-move-but-chance-based.134414/