How to add TP before a battle, and how to make an enemy immune to all except one attack?

I'm trying to get a scripted battle to happen where an enemy is immune to all attacks except one.
How would i go about doing that?
Or how do I make an enemy immune to all attacks except those that use TP ?

On a related note, for this battle i need my character to have at least 100 TP... but this is always changed at the beginning of a battle to 4 or 15. How do i get my TP maxed out for this scripted battle?
MZ at least allows you to directly increase TP in a troop. Just boost TP to that level directly.

I believe to be immune to all except one, you'd have to go through all the Elements listed in the Types part of the database, then probably make it immune to all states as well. Except, of course, the one you want to affect it.
MZ at least allows you to directly increase TP in a troop. Just boost TP to that level directly.
That's correct - just to clarify, you'd use a troop event that runs Turn 0 and increases the TP of whichever character you want to however much you want.

I believe to be immune to all except one, you'd have to go through all the Elements listed in the Types part of the database, then probably make it immune to all states as well. Except, of course, the one you want to affect it.
I don't think that necessarily addresses all of the OP's question - it was how to make the enemy not immune to one attack, or to all attacks that use TP. I personally wouldn't presume that the one attack has its own element, or that all attacks that use TP have the same element 😉

If that happens to be true, then this solution can work.

But in most cases, you'll have to do something like this: get VisuStella's Battle Core plugin and give the enemy a state with this in the notetag:
Code:
<JS Pre-Damage As Target>
if (this.isDamage() && !this.item().tpCost)
    value=0;
</JS Pre-Damage As Target>

I'm not super certain of a way to allow the effects (inflicting states or such) from some skills but not others without getting into writing more code just for this one enemy. I think you'd have to choose to make it resist all states or not, and just say it's immune to the damage portion.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-tp-before-a-battle-and-how-to-make-an-enemy-immune-to-all-except-one-attack.153804/