need help on money related events

Is there a way to make a event happen once you paid enough money to a certain person? As an example let's say we have this merchant who sells wares. He only sells the same things but once you buy 1000 of his items from him or you've bought 10000G worth of items he adds a new item to his shop or opens a secret passage to his secret shop.
Not really sure about that but i could suggest an alternative - You could assign Variables lets say from 1 to 5 and make a different Shop Processing event for each Control Variable. You could trigger the Variables depending on Conditional Branches like Switches that are active based on number of Items in Player inventory or Player Gold or Game Time etc.
This example basically check your current gold BEFORE shopping to be substracted by your gold AFTER shopping. The surplus will then be accumulated inside "Secret Unlock" variable.
1591426571245.png

Note that it only works if the type of shop is "purchase only", so you won't be able to sell things and confuse the variable check.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-on-money-related-events.122498/