Variable choices and avoiding nested conditional statements

 I'm working on a combat system that doesn't use the default combat system, but rather uses  variables and choices to fight (if I can get it to work, I'll have more control over combat)

I've run into a pretty nasty tangle trying to get the choice based targeting system to work. I was trying to use nested conditional statements and it worked fine till I got into the 4 choice stage. Then the nesting got so complex that I couldn't keep it strait.

 The idea is that, when you use a single target ability, it will give you the choice of which enemies to target. It uses a variable called Enemy#ThisWave to determine the initial choice.

 Then, as enemies die, it uses the TargetXIsDead switch to determine whether or not the enemy should be included in the choice at that point.

 The only way I can think of is to use nested conditional statements to check if each target is dead and then produce a choice based on how many targets remain alive.

 Is there a way to avoid/lessen the nesting problem?
not without scripts, but Tsukihime wrote a script "choice options" that should help here.

Original thread: https://forums.rpgmakerweb.com/threads/variable-choices-and-avoiding-nested-conditional-statements.52650/