Help with Lunatic code : Yanfly's skills

Hello everyone !

Thank you already for reading my thread. I need help and I hope that you will help me if you can.

So here is my problem :

I am using Yanfly's Enhanced TP plugin (here it is : http://yanfly.moe/plugins/en/YEP_EnhancedTP.js)

I am using it to create a system where each ally has a limit of 100 TP, but begins at 0 TP. TP is carried out over battles.
When an ally reach 100 TP, he can use an ULTIMATUM skill, wich is like an overdrive or limit break.
This system has been used in a lot of RPG's, and I have no problem doing it (it's already done in fact).

My problem is here : I want the player to have access to a different ULTIMATUM according to the TP mode he has chosen for each character.

Here is what I know to create such an effect :
- create all the ULTIMATUM skills and give them all to all players.
- Use the lunatic modes to make the skill visible only when a player's TP is at 100.
- Use the lunatic modes to make the skill visible (and enabled) only when a certain TP Mode is chosen.

Here are the lunatic modes that will help me (and you) to create this effect :

<Custom Show Eval>
</Custom Show Eval>

battler.tpModeId()

Now my problem is : I don't know any javascript at all. Could someone help to create the lines of code in this Eval to create this effect ?


Thank you very much in advance !!
Well, you can try:

<Custom Show Eval>
var tpMode = user.tpModeId();
if (user.tp >= 100 && tpMode === id) {
condition = true;
} else {
condition = false;
}
</Custom Show Eval>

Where id is the id of the Tp mode you want the skill to be shown for.
Thank you for your reply @Naveed !

It doesn't work, but I don't know why. There isn't any console error, but the skill is showing up even if my character doesn't have 100TP, neither the good TP mode.
Oops, my bad. I used condition instead of visible. Just change the terms 'condition' to 'visible'.

<Custom Show Eval>
var tpMode = user.tpModeId();
if (user.tp >= 100 && tpMode === id) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
Thank you very much ! It works now 🙂
One problem solved, thanks to you !

Original thread: https://forums.rpgmakerweb.com/threads/help-with-lunatic-code-yanflys-skills.81135/