Why does my skill only damage one Actor?

Hi,

I'm trying to create a Self-Destruct move and I've googled how to do a lot of it, but everything seems to be working except that only the lead actor takes damage? The rest either dodges it or takes 0 damage. How can I fix it that, as I put in my scope, all enemies take damage?
I'm posting both a screenshot of my Skill Page and a screenshot of the effect it has in battle below! (The damage formula is a bit long, so I pasted it in the Note part).

1709579665371.png

1709579509870.png
The formula is ran every time damage is calculated. It does 0 damage to the rest of the party because their HP was already set to 0 after the first hit and that'll be the hp used during the recalculations for the other actors.

You can use yanfly's action sequence plugin to ensure the enemy dies after all the calculations, or maybe try setting a variable on the enemy with math.max() so you csn retrieve it and to make sure you get the same HP value used an not the 0 for the other battlers.
Something like "a._sd = Math.max(a._sd, a.hp) || a.hp;" at the start of the damage formula and change the a.hp in the dmg variable assignment to a._sd
I can't test it but something like that could work
The formula is ran every time damage is calculated. It does 0 damage to the rest of the party because their HP was already set to 0 after the first hit and that'll be the hp used during the recalculations for the other actors.

You can use yanfly's action sequence plugin to ensure the enemy dies after all the calculations, or maybe try setting a variable on the enemy with math.max() so you csn retrieve it and to make sure you get the same HP value used an not the 0 for the other battlers.
Something like "a._sd = Math.max(a._sd, a.hp) || a.hp;" at the start of the damage formula and change the a.hp in the dmg variable assignment to a._sd
I can't test it but something like that could work
It works, thanks a bunch for your time and help!

Original thread: https://forums.rpgmakerweb.com/threads/why-does-my-skill-only-damage-one-actor.166470/