Need Assistance With Variable Multiplication Problem

Game Example:
In Order To Make Potion:
You Need : [Tool] Pestel And Mortar
[1] Flask[Empty]
[1] Blue Hyacinth
[1] Sun Lotus

Condition [If] Hero Has [Tool] Pestel & Mortar
Variables:
Flask[Empty] [Variable] = Game Data Amount of Flask[Empty]
Blue Hyacinth [Variable] = Game Data Amount of Blue Hyacinth
Sun Lotus [Variable] = Game Data Amount of Sun Lotus

How Many Would You Like To Make?
[Input # To Make Potion] [Variable]

[If] [Input # To Make Potion Variable] IS [Equal To or Less Than] Flask[Empty] [Variable]
[If] [Input # To Make Potion Variable] IS[Equal To or Less Than] Blue Hyacinth [Variable]
[If] [Input # To Make Potion Variable] IS[Equal To or Less Than] Sun Lotus [Variable]

[Sounds And Balloon Animations]
Change Items Flask[Empty] - [Input # To Make Potion] Variable
Change Items Blue Hyacinth - [Input # To Make Potion] Variable
Change Items Sun Lotus - [Input # To Make Potion] Variable
You Created Potion!
[Else] Not Enough Flasks[Empty]
[Else] Not Enough Blue hyacinths
[Else] Not Enough Sun Lotus
[Else] You Do Not Have A [Tool] Pestel & Mortar

WORKS GREAT IF YOU ONLY NEED 1 OF EACH ITEM

PROBLEM:

If You Want To Create A Potion That Requires 2 or More Of 1 Item How TO Multiply[Check] Variable Amount With
Input # To Create Amount Of Potions, I Can Make This Work But Will Have To Make 1 Potion At A Time
If I Want To Make Multiple Potions That Require Multiples Of Same Item How Would I Go About Doing This?
Or Is My Only Option To Simply Make 1 Potion At A Time If Multiple Amounts Of Same item Are Required:

EXAMPLE:

Create Master Potion:
Reqiures:

[1] Flask[Empty]
[3]Sun Lotus
[2]Moon Flowers

How Many Do You Want To Make?
Input Number[Variable] # of Master Potions

If You Input [5] To Make 5 MasterPotions
If Input #[Variable] [5] = Amount Of Sun Lotus Variable [5x]
It Will Require [15] Sun Lotus and [10] Moon Flowers And [1] Flask[Empty]

How Do I Use [Condition] Variable [IF] Statement To Check If You Wanted To Make 3 Master Potions
Would Need To Be Able To Condition[If] Input Number [Variable] Is [= to amount of [Game Data][Item] [5x of Input Variable]
Then Be Able To Remove The Required Amount From Inventory.

When Making 1 Complex Potion At A Time , Without [Input Number] To Create Multiple Amounts of Potions, There Is
No Problem, Only When Attempting To Create Multiple Potions, That Require More Than 1 of Each Item Is The Problem,

ANY SOLUTIONS PLEASE?
you can use loop, it will keep on doing it until the entered number amount of potions is 0, you have to check the is number of potions need count is 0 (or other conditions like if the number of items in inventory arent enough) and put them in the if condition at bottom so that if it happens it will not loop but exit the loop.
like:
Loop
if(number of potions needed>0)
{
your logic
decrease the number of potions needed by 1 (also decrease the number of items in the invenotry if you arent handling it anywhere else)
}
else { Exit loop}
repeat above
Its Ok, I Figured Something Out,
For The Sake Of Requiring [Tools] To Do Specific Things In Game,
There Is Always A Brief Segment Of [Preparing The Tool] Which A Random Variable Will
Possibly Cause You To Break The [Tool] Making You Need Another [Tool]
So Ive Decided For The Potion Making [Tool]Pestel and Mortar, To Simply Make 1 At A Time,
That Way I Can Make Potion Making Requirements Moderate to Complex For A Variety Of Potions.

Original thread: https://forums.rpgmakerweb.com/threads/need-assistance-with-variable-multiplication-problem.173920/