MZ Splash damage

I'm trying to replicate one of my skills whereby the actor hits one enemy for normal type damage, and every other member of the troop receives splash damage. I am, however, getting nowhere. I am using VisuStella plugins if that helps.

Can anyone enlighten me on what I should be doing?
Thanks.
What have you tried? I think this shouldn't be difficult to do using VisuStella action sequences.

But you could also add it onto your skill with something like:
Code:
<JS Post-Damage>
$gameTroop.aliveMembers().forEach(enemy => if (enemy!=target) enemy.gainHp(0-Math.round(value/2)))
</JS Post-Damage>

That should deal half damage to every enemy that isn't your selected target. I haven't done a lot of stuff with extra damage calls in notetags, you might need to manually call the damage popup.
@ATT_Turan Thank you very much for that.
One thing, though

you might need to manually call the damage popup
Bearing in mind that you're dealing with an MZ/JS ignoramus, how would I do that?
Bearing in mind that you're dealing with an MZ/JS ignoramus, how would I do that?
Do you need to? When you use the skill as I provided, do you see the splash damage pop up or no?

If you need to add it, then change the portion of the line after the arrow =>
Code:
if (enemy!=target) {enemy.gainHp(0-Math.round(value/2)); enemy.startDamagePopup()})
@ATT_Turan At the moment I can't test it because as soon as I try to load the game I get this error message

1666707985903.png


If I take out the JS code you gave, everything runs again normally, so it's definitely that which is causing the error.
Huh, can you not use conditionals inside arrow functions? Well, we'll just go the long way.

Code:
<JS Post-Damage>
for (let i=0; i<target.friendsUnit().aliveMembers().length; i++)
{
    if (target.friendsUnit().aliveMembers()[i]!=target)
    {
        target.friendsUnit().aliveMembers()[i].gainHp(0-Math.round(value/2));
        target.friendsUnit().aliveMembers()[i].startDamagePopup();
    }
}
</JS Post-Damage>
@ATT_Turan That's fixed it. And yes, the amount of damage dealt to other members of the troop shows up. So we can take this as a success.

Once again thank you very much.

Original thread: https://forums.rpgmakerweb.com/threads/splash-damage.152173/