Possible to apply state to character randomly each turn?

Hello,

I am wondering if it is possible to apply a state to a character each turn in battle.

What I am aiming to do is have a character turn into a wolf which increases that characters skills but I want the draw back to be that each turn that passes with the "wolf state active" there is a chance that the character will fall into "confusion" state meaning he will attack allies.

Is this possible?
You can set a troop event to run every turn that'll check whether or not the state should be applied. Just set a variable to a random value (this'll act as your probability), then check the variable's value and whether or not the actor has the werewolf state. So, something like this:
6IWf5Wn.png


This setup says that for as long as Eric is a werewolf, there's a 50/50 chance each turn that he'll become confused.
You can set a troop event to run every turn that'll check whether or not the state should be applied. Just set a variable to a random value (this'll act as your probability), then check the variable's value and whether or not the actor has the werewolf state. So, something like this:

6IWf5Wn.png


This setup says that for as long as Eric is a werewolf, there's a 50/50 chance each turn that he'll become confused.
Actually I don't want to edit all the troops but you did give me a good idea for a common event call! Randomized variables should do the trick.
There are scripts that use the first troop as a template for troop events, resulting that the first troop's events will be executed for every troop without need to copy them into other troops.
Pretty sure DoubleX Just got through updating his State Turn script to handle something like this.
There are scripts that use the first troop as a template for troop events, resulting that the first troop's events will be executed for every troop without need to copy them into other troops.
After spending minutes searching, I can't find such script you mentioned. Could you name the script? I think isuch script would be very handy for my project too.Thanks
Yanfly's Base Troop Event does this and is straightforward to use.  I'll see if I can find the direct link

EDIT

Here it is https://github.com/Archeia/YEARepo/blob/master/Utility/Base_Troop_Events.rb
Yanfly's Base Troop Event does this and is straightforward to use. I'll see if I can find the direct link

EDIT

Here it is https://github.com/Archeia/YEARepo/blob/master/Utility/Base_Troop_Events.rb
Thanks a lot for the link!

Original thread: https://forums.rpgmakerweb.com/threads/possible-to-apply-state-to-character-randomly-each-turn.40224/