Conditional Branch for Item Requirement.

Hey RMMV community!

I've been playing with a new conditional branch absolutely necessary for certain mechanics of my game and it doesn't seem to be processing well. The source of where I found this script was here: https://steamcommunity.com/app/220700/discussions/2/523898291496333465/

I've attached several images below.
-Event Info.png shows the event, the conditional branch script and how its all written out. Pheonix down's item ID is 0012, i made sure of this.
-TheOption.png shows the choice where the choice takes place that makes the error. The error undergoes when the first option is selected. I made sure to have 10 item ID 0012's (Pheonix Downs) but it still causes an error and forces the player to go down the Else path, where no conversion takes place.
-TheError.png shows the debug console that appears when the error takes place. Below where it was highlighted it did note to make sure ItemCore (from Yanfly) was up to date, so (to be safe) I reinstalled it and replaced it. The error still takes place.
-GoesDownElsePath.png only shows that, in fact, after the error screen appears the player goes down the "Else" option, which is supposed to take place if the player chooses to convert pheonix downs into Nia Potions but doesn't have enough Downs.

Thank you if you can help! It'll be a big step towards my game's vision.

EDIT: The goal for the NPC is (after their sidequest is finished) open up the option to exchange 10 Pheonix Downs (itemID 0012) into 1 Nia Potion (itemID 0013).
Why use a script for this at all?

Just use control variable to get the number of phoenix downs in the player inventory and check that in the conditional branch...
Why use a script for this at all?

Just use control variable to get the number of phoenix downs in the player inventory and check that in the conditional branch...

I've heard about people commonly using variables to track how much of a number of items they current have on them. How would i make sure the variable is kept up to the number of Downs on me without having to go through the game and add "+1" for everytime the player gains a Pheonix Down?


EDIT: I found out how to set the variable to the # of item in possession through Control Variable -> Game Data.

For others and personal future reference: Make a variable to track the number you have, you wont need to update it each time it comes into possession. Right before the variable amount becomes relevant, make a "Control Variable -> Game Data -> Item -> Item you wish to count. Set the operation to "Set" and there ya go!
Control Variables => Game Data => Item => Choose the item you want and it will count the number of items you have.
Control Variables => Game Data => Item => Choose the item you want and it will count the number of items you have.
^ Thank you @JamesRyan and @Andar !

Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-for-item-requirement.86110/