Using Conditional Action Sequences & States to Modify Skill Effects

I'm trying to create skills with an action sequence that will:

1) Check the user for certain states
2) Modify the skill effect depending on which state the user has (the user will only be able to have one of these states active at a time).

When the skill only has two possible effects (the default mode and a single state-based mode), the sequence works perfectly. However, when I try to add a third mode, it will execute the default mode before the third mode, adding extra hits and animations to the effect. It also introduces some game-breaking bugs, like permanently blacking out the screen, or closing the game window if the default effect kills the target before the third mode is executed (the sequence skips over the rest of the skill and deactivates immortal targets, allowing the target to die when the skill isn't finished).

Here's the incomplete sequence:

<setup action>

display action

hide battle hud

camera focus: user, front

zoom: 125%, 15

wait for zoom

motion spell: user

wait: 5

cast animation

wait for animation

immortal targets: true

</setup action>



<whole action>

</whole action>



<target action>

//Default mode

if (!user.isStateAffected(27))

reset zoom

reset camera

camera focus: target

zoom: 125%, 15

wait for zoom

animation 158: target

wait for animation

action effect: target

death break

end



//Splash mode

if (!user.isStateAffected(27))

Jump to Label: End

else

reset zoom

reset camera

wait for camera

animation 69: enemies

wait for animation

action effect: enemies

death break

end



//Missile mode

if (!user.isStateAffected(28))

Jump to Label: End

else

reset zoom

reset camera

wait for camera

animation 160: user

wait for animation

animation 163: enemies

wait: 30

animation 164: enemies

wait for animation

action effect: enemies

death break

end



Label: End

end



</target action>



<finish action>

immortal targets: false

reset zoom

wait for zoom

MOVE user: RETURN, 20

wait for movement

clear battle log

show battle hud

remove state 27: user

remove state 28: user

</finish action>

I know that I basically need a way to tell the skill to run "if (!user.isStateAffected())" for both states 27 and 28 (as well as others I might add in the future), but I'm still learning RMMV's terms and haven't found a successful way to implement this yet. If anyone could show me the proper way to make the sequence only execute a single effect depending on which state the user has, I'd appreciate it!

As a bonus question, I want to modify the number of targets affected by skills with some modes - is there a way to change the actual targeting phase of the skill to reflect this? I glanced through Yanfly's Selection Control plugin, but the closest thing I saw was being able to mark targets as valid with a state. Since multiple party members will have access to these modifiers, though, I'm worried this could lead to further issues later on in development.

Thanks!
I think I'm going to try to use Hime's Scope Core and Scope Change Rules plugin to solve the targeting issue I mentioned, but I'm still looking for an answer to my first question, if anyone can help.

To summarize, how can I give an action sequence multiple conditional effects which are triggered by specific states, and how can I have it execute only one condition per action? I can get two branches to work properly, but not more than that. What am I doing wrong in the sequence above which is causing it to trigger multiple effects at once?

Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/using-conditional-action-sequences-states-to-modify-skill-effects.96132/