Setting an Item Price to a Variable?

Hello! I'm trying to find a way to set an item price to a variable. I wanted to set up a system in which you can sell items by leaving them in a shop (through item selection) and having them sell over time. I managed to find most of what I needed, but I wanted to be able to set the value variable to the normal buying price so that the system would be worth more than just selling to a shopkeeper. I originally planned to use conditional branches, but now I have over 300 items and I plan on adding more. Is this at all possible?
Nevermind, I figured it out. ^.^

$gameVariables.setValue(49, $dataItems[$gameVariables.value(40)].price) is what I used, in case you need it.

Original thread: https://forums.rpgmakerweb.com/threads/setting-an-item-price-to-a-variable.83111/