This script allows battlers to store a state’s caster, the battler that applied the state. If the state was applied through events or other means, then there is no caster.
It is useful for scripts that need to know who applied a state.
Script: download here
In the script editor, place this script below Materials and above Main
This script provides one method that allows you to check the battler that originally inflicted a state. In a damage formula, for example, you can say
a.state_cause(4) == $game_actors
Which would determine whether actor 3 had inflicted state 4 to the current skill user.
state_cause method returns a