[ACE] I want to use an item to restrain max TP on a character.

I've added Yanfly's Ace Equip Engine to add an additional equip slot for my characters.

For one particular character, I want to use an accessory type item to restrain that characters max TP.

I realize that what I'm asking is not very clear. I will see if I can alleviate the potential for confusion.

1. The max TP for the character is 100, and it will remain at 100, and 100 will be the max amount the character could gain.

2. The item equipped needs to put a restrained max on the TP gained. For example, if the restrained max with that item equipped is 90, the character can earn up to 90 TP, and would show up as 90/100. With that item equipped, any TP gained over the restrained max would simply not be applied. 

3. The reason for this is due to another script that causes the character to enter a particular state when their TP reaches 100, 

4. The item is intended to be a stopgap measure while the player learns to manage that characters TP.

With the other script help I've been asking for help with, I have realized that there really are not a lot of good ways hard coded into VXACE to manipulate TP. 

I'm going to assume that in order to pull this off, another script will need to be added to process this additional TP manipulation. For the moment, I will be working on adding the item to the character and attempting to implement the desired effect. If anyone has any pointers on which areas of the default scripts that I should look at, it would be most appreciated.
So, as I'm typing this on phone, I do not have access to the scripts.

But I still can help you. A bit.

1. Enter the Script Editor (F11)

2. Click CTRL+SHIFT+F

3. In the search window that appears type

self.tp +=4. The search box will appear, and you will see all places where entered code appears.5. Go to every place that appears in the search box and in the line directly below the line with "self.tp +=" add

self.tp = 90 if self.tp > 90 && $game_party.has_item?($data_items[your_item_that_restricts_tp_index])6. Test if it works, and sorry for bothering if it does notEDIT :

Also, search for ".tp +="

When you find that line it may be written like

Code:
something.tp += somethingother
Well, below those places enter
Code:
something.tp = 90 if something.tp > 90 && other_stuff_i_wrote_above
If it throws an error, it may be that you don't need $data_items[index] stuff, just enter the index in parameters
The amount of help you've given, as always, is exactly what I need to figure it out! Truly fantastic. Thank you so much KockaAdmiralac_FINALLY! I'll fiddle with it and see what I come up with.

Original thread: https://forums.rpgmakerweb.com/threads/ace-i-want-to-use-an-item-to-restrain-max-tp-on-a-character.43080/