Can't use ability while ability is active

Using Victor's Command Change script, I've created a character who can use an ability called Transform. Transform has a cost of 60 TP. Transform changes the attack command into a fury command, as well as bestowing a temporary 25% MHP buff. It lasts for 5 turns.

The character generates TP through attacking or using special skills. It is possible to save up enough TP and use TP-generating skills while transform is active to have enough TP to use transform again before it has actually worn off.

What I'd like to do is make it so that the transform command is simply greyed out while transform is still active, regardless of your level of TP.

I *have* managed to get it so that, as long as transform is active, the guard command appears - however, I don't like the guard command. I don't want the guard command to appear in my game (each character has some unique ability that is replacing the guard command). I tried renaming my guard command in my database to transform, and making it cost 100 TP, so as to create a "dummy" transform command that would only appear while transform is active, but it still appears as "Guard" no matter what I actually name it. This leads me to believe the name "Guard" is hardwired into the RTP scripts somewhere, but when I went searching for all instances of its use (vocab, scene_battle, etc.) and tried changing various lines from guard to transform, it either did nothing or caused crashes, so I reverted everything back to guard.

I also tried creating more command changes using Victor's script, but it appears to only be capable of handling one command replace per "slot." For example, my transform command turns game_switch(8) on. So I tried having the actual transform active while game_switch(8) is off, then the "dummy," expensive transform command active while game_switch(8) is on, but it simply broke both and wouldn't allow the transform command to function whatsoever, instead just leaving "guard" in its place.

I could increase the cost of transform to 85-100 TP, which would eliminate the ability to generate enough TP to use it a second time while it's still active. However, it would cause the ability to be extremely rare to use, leading the player to likely only use it for boss fights and only having the opportunity to do so once, maybe twice. This is not an acceptable solution.

I could decrease the amount of TP generated by the other abilities, but it causes the same issue.

In short, what I'm trying to do is make it so that when the transform command is used, you cannot use the transform command again for 5 turns, regardless of your TP level.
There are scripts that allow you to place conditions on the skill use (as well as other costs forms).

Check those scripts if there is one that allows negative conditions like "can use only when state X is not active".

That would be the easiest way to prevent that.
Victor's command change script does allow for condition checks. For example, this is what the transform template looks like right now:

<command replace: guard>
name: Transform;
type: direct skill;
ext: 127;
condition: $game_switches[8] == false;
</command replace>

<command replace: attack>
name: Fury;
type: skill;
ext: 3;
condition: $game_switches[8] == true;
</command replace>

I tried adding something like:

<command replace: guard>
name: Revert;
type: direct skill;
ext: 15;
condition: $game_switches[8] == true;
</command replace>

But all it does is cause all of the above to stop working. So it appears I can only replace any one particular command once per character.

I tried doing some searching on these forums and on Google for conditional skill use scripts but haven't turned anything up yet - and I'm not exactly sure what you're referring to. Could you give me a link to an example of what you're talking about?

EDIT: I swear I tried this option earlier, but since you mentioned states, I decided to go back and take a look and see if I could just seal that particular skill with a dummy state. It turns out, yes I can - so in the transform common event that gets called when transform gets used, I just had to add a state that seals the transform skill. When the revert common event is called (done after using 5 fury abilities using a furycounter variable), the skill is unsealed.

Thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/cant-use-ability-while-ability-is-active.16841/