If preserve TP flag in on, show TP not MP

I am looking for a script to display a TP bar where the MP bar usually is in the menu windows (main and status) if that actor has the preserve TP special flag on.  (color of bar: 10).  If the actor does not have the preserve TP flag on, than MP should be displayed as it normally would.
Yanfly's Ace Menu Engine does that, you can get it here  Set line 77 to true.

However, that's a full menu script, which may be more than you want.

Original thread: https://forums.rpgmakerweb.com/threads/if-preserve-tp-flag-in-on-show-tp-not-mp.42557/