how to fix skill gain TP?

Hi, Me again with another problem :'D

I want to have a skill that targeting all enemies and only gain 1 TP for the user. I try 2 method but the TP still gain according to the number of enemies.

Method 1
1662693568150.png


method 2 with js
JavaScript:
 <JS Pre-Apply>
  user.gainTp(1);
 <JS Pre-Apply>

anyone know how to achieve it?
Why not just attach a common event to the skill, and have the common event give the user 1 TP? You can get the ID of the actor that used the skill in Control Variables -> Game Data -> Last. Or if you prefer to avoid using a variable, you can use this script call in the common event:

JavaScript:
$gameActors.actor($gameTemp.lastActionData(2)).gainTp(1);

Otherwise, depending on when you want the TP gain to happen, any one of these note tags should work with Battle Core:
Code:
<JS Pre-Start Action>
 code
 code
 code
</JS Pre-Start Action>

<JS Post-Start Action>
 code
 code
 code
</JS Post-Start Action>

<JS Pre-End Action>
 code
 code
 code
</JS Pre-End Action>

<JS Post-End Action>
 code
 code
 code
</JS Post-End Action>
Why not just attach a common event to the skill, and have the common event give the user 1 TP? You can get the ID of the actor that used the skill in Control Variables -> Game Data -> Last. Or if you prefer to avoid using a variable, you can use this script call in the common event:

JavaScript:
$gameActors.actor($gameTemp.lastActionData(2)).gainTp(1);

Otherwise, depending on when you want the TP gain to happen, any one of these note tags should work with Battle Core:
Code:
<JS Pre-Start Action>
 code
 code
 code
</JS Pre-Start Action>

<JS Post-Start Action>
 code
 code
 code
</JS Post-Start Action>

<JS Pre-End Action>
 code
 code
 code
</JS Pre-End Action>

<JS Post-End Action>
 code
 code
 code
</JS Post-End Action>
Nice! its work! I prefer use the note tags. The skill will be used only by enemy boss

Code:
<JS Pre-End Action>
 $gameTroop.members()[0].gainTp(1);
</JS Pre-End Action>

Thanks for the help! :XP02:

Original thread: https://forums.rpgmakerweb.com/threads/how-to-fix-skill-gain-tp.151176/