How do you create a random sales event for a shop without making already purchased items go on sale again?

Oops. Change the third line up in my code to:
Code:
$gameVariables.setValue(364, shopValues[Math.randomInt(shopValues.length)]);
Hey! It worked! You're a life saver, thank you so much, and once again thanks for having patience while I tried to make things more clear.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-create-a-random-sales-event-for-a-shop-without-making-already-purchased-items-go-on-sale-again.157792/