Needed help with a Javascript / Event Function

So, I came across this thread : https://forums.rpgmakerweb.com/index.php?threads/eventing-a-place-able-crafting-system.83283/

Its about Crafting something using 3 Ingredients. Could someone tell me how could i make it so I could craft (Cook) with only 1 Ingredient ? I figured i would just remove the extra Variables 2 and 3 and functions associated with it. I was able to place the Item fine on the Kitchen Cabinet. But when i headed to cook it, It caused an error. I'm sure it has something to do with Multiple Variables and the way it was declared.

So if someone could explain how i could achieve this with just one Variable and Ingredient, It would be great 🙂 If you still don't get what i mean, I mean like : Placing an Ingredient, Cooking it. That's it, No Combinations of Ingredients.

(Edit : It seems I can just delete the other 2 Ingredient Events and pretend like they don't exist and i can get the desired result, just fine. But I'm still curious on most efficient way of achieving this)
so far in the event use arrays (2+) object, you can just go with 1 item.
but you dont really need a script for this, it depends what you want?

like you want fried fish, and it need 1 fish.
than why not on the cook event, cook fried fish?

than show choices yes, no
if yes,
conditional brance, if fish is > 1
cook fried fish
else
you dont have enough fish.
end

but this is a basis, but if you use more items, array can be usefull

Original thread: https://forums.rpgmakerweb.com/threads/needed-help-with-a-javascript-event-function.121200/