State Add/Remove Commands v1.01 ShazIntroduction This script lets you enter RGSS script commands to be run when a state is added or removed. Like calling a common event when a state is added, or setting one state to be replaced by another after a certain number of turns. Versions Spoiler Code: 1.01 26 May 14 Fix issue with + sign in regular expressions Features - Make something happen when a state is removed. - Multiple commands may be run for a single state. How to Use Paste the script into a new slot below Materials. In a state's note box, enter onadd: command or onremove: command, where command is any valid RGSS script command. If a command requires more than will fit in the note box, allow it to wrap to the next line automatically - do NOT use the enter key to go to a new line. Anything from onadd: or onremove: to the next manual line break will be executed. You may have several onadd: or onremove: commands for a single state. Script Get it here Examples If you want to call common event 8 when a state is added, enter the following as the note: Code: onadd: $game_temp.reserve_common_event(8) If you want state 16 to be added when state 15 is removed (replace one state with another), enter the following into the note of state 15: Code: onremove: add_state(16) If you want to add a new state when state 20 is removed, and that new state will be 21 if the battler’s hp is 50% or higher, and 22 if lower, enter the following into the note of state 20 (allow it to wrap automatically) Code: onremove: if hp_rate < 0.5; add_state(20); else; add_state(21); end; You could also enter this to achieve the same thing: Code: onremove: add_state(hp_rate < 0.5 ? 20 : 21) Feel free to provide a scenario in the comments, and I will give you the command you should use. Game_Interpreter is a good place to look, and any of the properties or methods in Game_Battler or Game_BattlerBase can be used. FAQ Credit and Thanks - Shaz Author's Notes Free to use in commercial games. Please give credit.