Skill that causes damage to multiples enemies but individual targets...

As is well known: when creating a skill you can choose the range of the scope you want.

but in this case I want to concentrate on 2:
To a single enemy
and to multiple enemies

if you set a skill that causes damage to multiple enemies it will cause damage to a individual troop/enemy as many times as the number you gave him.

browsing the forum I found this topic about it and found the yanfly's script (target manager),
https://forums.rpgmakerweb.com/inde...-attacks-a-single-enemy-multiple-times.28943/

but it did not help me at all because it ignores the number of hits I set
(i tried <total hits: x> and <targets: target x random foes>)

Most of my scripts are from yanfly, even the battle system.

Is there any possible solution?
I am doing something wrong?

Thanks.
So you basically want the skill to deal damage only once per target even if it hits more than one target?
So you basically want the skill to deal damage only once per target even if it hits more than one target?

Yes.
I can think of two ways of doing it, both are workarounds. The first one is to use your skill to call a common event to store all the potential targets into an array and then pick two random targets from the array, removing the one picked each time and forcing an action against that target (the action is the real skill).

The second way is to use a similar method to store potential targets into an array, set the skill to be an AoE skill (all enemies are targets), pick two targets from the array and remove the other ones. Doing this you can use the damage formula to deal 0 damage to anyone who is not in the array.
I can think of two ways of doing it, both are workarounds. The first one is to use your skill to call a common event to store all the potential targets into an array and then pick two random targets from the array, removing the one picked each time and forcing an action against that target (the action is the real skill).

The second way is to use a similar method to store potential targets into an array, set the skill to be an AoE skill (all enemies are targets), pick two targets from the array and remove the other ones. Doing this you can use the damage formula to deal 0 damage to anyone who is not in the array.

Well, my last option was to do something through events and conditions by common event and several identical skills but with different number of objectives, depending on the number of living enemies the availability will be exchanged

but this solution seems more practical. thanks a lot.

Original thread: https://forums.rpgmakerweb.com/threads/skill-that-causes-damage-to-multiples-enemies-but-individual-targets.109561/