Trouble with healing formula

My problem is a simple one. I want my healing spell to work within a certain range. To be specific, I want it to heal between 35-45 HP a cast. I currently have the formula set as the following:

Math.randomInt(45)+35

This is not working as intended, however. I've seen healing numbers go beyond my desired limit of 45. Does anyone know where I've gone wrong?
Well, you're saying take a random number between 0 and 45, and add 35 to it. So if the random number happens to be 40, you're going to get 75.

Math.randomInt(11) will give you a number between 0 and 10,
so Math.randomInt(11) + 35 will give you a number between 35 (35 + 0) and 45 (35 + 10)


However ... can't you just set the damage to 40, with a variance of 5?
Use shaz's solution above then set variance to 0
Shaz, your formula worked. Had a feeling I was ignoring something obvious.

And yeah, I probably could've just relied on the variance, but I wanted to make absolutely sure. Anyway, can an admin close this thread when they get the chance?
If your question is resolved, just report your first post and ask the mods to close the thread.
So that's how you do it. Thanks again, Shaz.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/trouble-with-healing-formula.102542/