Boss Atacking Multiple Times per Turn

Hi guys, I wanted a boss to attack multiple times per turn because of reasons, so I thought to code some skills to it like this:

Spoiler: Code
<Target Action>
move user: targets, front, 20
wait for movement
motion attack: user
wait for motion
attack animation: target
wait for animation
action effect
wait for action
COLLAPSE: target
</Target Action>

<After Eval>
var id = user._enemyId;
var skill = 108;
var target = -1;
BattleManager.queueForceAction(user, skill, target);
</After Eval>

My problem is, that if after the first skill the character dies, the skill is going to be used again in him, because my character doesn't collapses untill the 2nd skill is performed.

Some1 knows how to fix this?
It looks like you're using a plugin for this. We don't know what it is. We also don't know what skill 108 is or does.

However, I would suggest using an if statement to check the target is alive within your <After Eval> block, if it is, evaluate what you already have. I wouldn't know how to check the target is alive myself using a script, but I would imagine this is how it would look:

Code:
<After Eval>
if (target._hp > 0) {
   var id = user._enemyId;
   var skill = 108;
   var target = -1;
   BattleManager.queueForceAction(user, skill, target);
}
</After Eval>

Substitute in the correct code for the check, I doubt what I've used is correct.
It looks like you're using a plugin for this. We don't know what it is. We also don't know what skill 108 is or does.

However, I would suggest using an if statement to check the target is alive within your <After Eval> block, if it is, evaluate what you already have. I wouldn't know how to check the target is alive myself using a script, but I would imagine this is how it would look:

Code:
<After Eval>
if (target._hp > 0) {
   var id = user._enemyId;
   var skill = 108;
   var target = -1;
   BattleManager.queueForceAction(user, skill, target);
}
</After Eval>

Substitute in the correct code for the check, I doubt what I've used is correct.

Yeah, I am using STB, ive been searching and ive found a little fix using ITB plugin, but I need a quick fix on it to do as I wish, I hope DreamX reads my post and wants to do it, I think wont be hard for him. If not, I am gonna try that, is not the best solution, but I think will work

Original thread: https://forums.rpgmakerweb.com/threads/boss-atacking-multiple-times-per-turn.105526/