Specific variable TP on battle start

Following a conversation over on Games Mechanics Design, I am now trying to find a satisfactory compromise between preserving and not preserving TP.

My complaint with the standard not preserving is that the random amount given at the beginning of a battle can be as low as zero or mostly 7 or less. I am, therefore, looking for a way to change that to something a bit more chunky.

I know how to make it so that the actors start with the same specific amount of TP every battle, but I would like some variance.

Can anyone tell me how I can have a set variance, e.g. 17-22 or 11-19, or whatever band I'm comfortable with after balancing?

Thank you.
Code:
class Game_Battler
  def init_tp
    self.tp = rand * 25
  end
end
This is the default code. The rand part is to generate a number between 0.0 to 0.999999. So by default, it generates 0 to 24.

To make it bend to your will like your example, first you need to decide the minimum value. For example, you picked up 10. Then you want the variance to be somewhere around 0 ~ 9
Code:
class Game_Battler
  def init_tp
    self.tp = 10 + (rand * 10)
  end
end
This should do the trick.
@TheoAllen Thanks for that, seems to be what I'm looking for. I shan't be able to test for a few hours, but when I have I'll get back to you.

EDIT
Tested it and it works like a charm.
Thank you very much for your help.

Original thread: https://forums.rpgmakerweb.com/threads/specific-variable-tp-on-battle-start.118995/