This script allows you to create “conditional states”. A conditional state is simply a placeholder for other states, depending on the conditions at the time the state is applied.
For example, suppose you have a skill that adds a Weak Poison state to a target if it is not already poisoned, and adds a Strong Poison state if it has Weak Poison inflicted. You can use a formula to determine whether the weak poison has been added or not to determine which state should be added.
Script: download here
In the script editor, place this script below Materials and above Main
To create a conditional state, note-tag a state with
<conditional state> FORMULA </conditional state>
Where the formula returns a number, which is the state ID that will be applied. If you don’t want a state to be applied, you can use 0.
The following formula variables are available
a - the battler that the state will be added to p - game party t - game troop s - game switches v - game variables
Assuming you have two states Weak Poison (12) and Strong Poison (13), you can create a conditional state (14) that will add Strong Poison if Weak Poison is already applied, or apply Weak Poison otherwise.
<conditional state> if a.state?(12) 13 else 12 end </conditional state>