MZ Limit the maximum amount you can input via 'Input Number' with a variable

Hi there, everyone!

So the title's a bit of a mouthful, I apologise, but the general gist of what I'd be looking for is something that acts as an extension onto the current 'Input Number' command that comes with RPG Maker MZ. In that I'd wish to limit the highest possible number you can put into it, with the limit defined by a variable.

For an example of where I'd use this--among other things--is that I have a move where you can throw money at the enemy, and you input the number yourself via the input number command. And if you enter a number over the amount you have, I have to throw a clunky message saying that you don't have that much, and then loop back to trying to again. (I suppose I could also just have all possible money used regardless, too, but it's still not ideal.) My hope is that a plugin that can potentially ensure you can only ever input on the box the highest limit defined by the variable and that it would either wrap back around to 0 if you tried to go higher, or would just refuse to accept any further input to increase the number past that point.

I did a few searches around to see if I could find anything--as making threads is often my last resort, haha--but as far as I could see the closest thing was for MV, and maybe seemed more rigid than what I was looking for, and its plugin commands won't work with MZ regardless.

If it's more complex than I initially thought to implement, I'll happily see about getting this moved to classifieds or something as it is something I'm willing to invest in despite how limited its use case might be, haha. It's important me, darn it!

Ah, right, and I use Visustella plugins (all the main cores like message, etc.) in case this complicates things.

Thank you for your time! And if I wasn't clear enough on any details or more information is required, please let me know!
there was another plugin using a scriptcall for MV, as there are a few,
I dont know if those are equal to MZ, but I can check later in if I can
find later for you.
There is a plugin that can limit variable number, so you can still input grather one, but if you limit variable to X, then it can't be above that. You can make it like after inputting the grather than X number, player got message "Maximum is X, so it's set to X".
there was another plugin using a scriptcall for MV, as there are a few,
I dont know if those are equal to MZ, but I can check later in if I can
find later for you.
Heya, thank you! I'll appreciate whatever you might be able to dig up!

There is a plugin that can limit variable number, so you can still input grather one, but if you limit variable to X, then it can't be above that. You can make it like after inputting the grather than X number, player got message "Maximum is X, so it's set to X".
Heya! Thank you! This is the sort of method I was employing already with a check after the number was input and then bumping it back down if it went over as a failsafe sort of thing, but admittedly I was looking to see if there was a more elegant solution where input can be limited in the input menu itself where the player is putting the numbers in. If it proves to be too convoluted or tricky to implement though this is definitely what I'd do.

Original thread: https://forums.rpgmakerweb.com/threads/limit-the-maximum-amount-you-can-input-via-input-number-with-a-variable.154411/