Can an event check for "the lower variable" among 3+ variables?

Im eventing a gambling mini game in wich the player and an event both choose a random 1~20 number and then roll a dice. The one who guessed closest wins. But I'm not sure if I can make this with more than one npc-gambler, because i'd have to make a variable for each one (the number they bet) and then check the closest to the dice roll. Any thoughts?

edit: this is my first post, I realized it's in the wrong section (I think) and I don't know how to move it. Sorry about that
You can do this:
let minValue = Math.min($gameVariables.value(ID), $gameVariables.value(ID), $gameVariables.value(ID));
$gameVariables.setValue(ID, minValue)

With this, you can store the minimum value of the variables inside the Math.min function in another variable. So you can check the lower value.
Sorry, I'm kinda noob and I have literally no idea what this means. Could you explain to me how do I use this? It's a plugin? I've never used one
Got it. Thank you very much!

Original thread: https://forums.rpgmakerweb.com/threads/can-an-event-check-for-the-lower-variable-among-3-variables.121438/