How do I check an Enemy's TP?

Basically what I am looking for is the equivalent of this Conditional Branch script:

$gameActors.actor(1).tp < 10

except for enemies instead of actors.

I tried $gameEnemies.enemy(1).tp < 10 and I got an error.

I tired $gameTroop.members(1).tp < 10.  Though I didn't get an error that time - the conditional branch doesn't seem to be working.  It was the same result with $gameTroop.members(0).tp < 10,

Does anyone know how to set up a conditional branch that checks an Enemy's tp?
Enemies don't have TP.
Enemies don't have TP.
Are you sure?

Because it seems like they do in my troop event.  

For example: my enemy stops using the skill I have him programmed to use when the cost is 10 tp.  It just sits there and does nothing.  When I reduce the cost to 0 tp the skill starts activating again. 

If they don't have TP why is that the case?
Having 0 tp is the same as not having access to tp

What is your goal for the skill?
Having 0 tp is the same as not having access to tp
Also I can leave the skill at 10 tp cost.   After I hit the enemy the skill will begin to activate again giving the impression it was because I fed it TP.

So if the enemy doesn't have TP why can it use a skill that requires 10 TP after I hit it?  But before I hit it the skill doesn't activate?

 

What is your goal for the skill?

 
The skill is nothing special.  It's just a straight up HP Damage skill.
Not true, enemy do indeed have TP. Enemy and Actors both inherit the Battlebase class. If an enemy do not have enough TP, they will not use a skill that requires the correct amount of TP, unless forced to do so by event, just like MP.

You can grab enemy TP like so:

$gameTroop.members()[0].tp0 is enemy at the first position, 1 is the second position and so on.
Enemies do have TP.


If you get an error, please state what the error is, as that helps us figure out what's wrong with the syntax.


$gameTroop.members() returns the whole member array, and doesn't take any arguments. It's not like $gameActors.actor(id)


$gameTroop.members()[1].tp
Not true, enemy do indeed have TP. Enemy and Actors both inherit the Battlebase class. If an enemy do not have enough TP, they will not use a skill that requires the correct amount of TP, unless forced to do so by event, just like MP.

You can grab enemy TP like so:

$gameTroop.members()[0].tp0 is enemy at the first position, 1 is the second position and so on.

Enemies do have TP.

If you get an error, please state what the error is, as that helps us figure out what's wrong with the syntax.

$gameTroop.members() returns the whole member array, and doesn't take any arguments. It's not like $gameActors.actor(id)

$gameTroop.members()[1].tp
Thank you both.  That was exactly what I needed and my Enemy AI is working correctly now.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-check-an-enemys-tp.54774/