MV HELP! Can I set different initial TP per enemy?

Hi!
im looking to modify the method initTp() in rpg_objects so i can set an initial tp per enemy Id. That way My bats enemy id 1 will have 20 tp but my ogre Id 3 will have 50 when the initTp() run .

Is this possible? Now, I know that I could make some events at the beginning of a battle and identify the troop member Id and set the tp that way, but in this case I need to do it on the initTp() method.

thank you!
Try this:
Spoiler: plugin code
JavaScript:
/*:
 * @target MV MZ
 * @plugindesc <initTp: X> notetag for Enemy/Actor/Class/Armor/Weapon/State.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/160715/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (function(alias) {
'use strict';
  const TAG_NAME = "initTp";

  const fMap = function(o) {
    return parseInt(o.meta[TAG_NAME], 10);
  };

  const fFilter = function(o) { return o; };

  Game_Battler.prototype.initTp = function() {
    const tags = this.traitObjects().map(fMap).filter(fFilter);
    if (tags.length)
      this.setTp(Math.max.apply(Math, tags));
    else
      alias.apply(this, arguments);
  };

})(Game_Battler.prototype.initTp);

I've moved this thread to JS Plugin Requests (from MV Support). Thank you.

im looking to modify the method initTp() in rpg_objects
Just to quickly point it out - that's bad/risky practice.

You should copy the function you want, place it into a new *.js file, and modify it there; then include it as a plugin.

That way you know what you've changed, all your changes are in one place, and you know what the original code was.

Original thread: https://forums.rpgmakerweb.com/threads/help-can-i-set-different-initial-tp-per-enemy.160715/