[VXA] Tie a Variable to an item # without parallel process?

Hello.

I use VXA. Is there a way to tie an item quantity to a variable that constantly checks it without a parallel process? I have item limits, but the game doesn't seem to tell you if you have the max amount when opening for example, Chests.

An example, you open a chest and it contains 1 Rock, but you can only carry 20 rocks at a time, so the event would deny you the possibility of receiving that rock, due to the max amount. So a message of "You can't carry more of this item" shows up.

I know you can tie items to variables and set up a conditional branch with this, (+1 to the variable whenever you receive one), but what if you are able to sell/use those items within the chest? How would you be able to keep track of that? Maybe I'm overthinking it, but I'd like help on this.

I currently use this script for item limits, but I'm willing to switch to any other if it gets me what i want.
github.com/Archeia/YEARepo/blob/master/Core/Adjust_Limits.rb

Thanks for any help 🙂
In the event, use a conditional branch with "script" as the condition:

Code:
$game_party.item_number($data_items[id of item the chest contains]) < $data_items[id of the item].max_limit

Then inside that branch do whatever will happen if they haven't reached their max yet, and make an else branch to tell the player they're already carrying their limit of that item.
Thank you so much! That completely works for what I want. 😍

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/vxa-tie-a-variable-to-an-item-without-parallel-process.123498/