Could you create a global variable to track/count coins as they are spawned? Then your 'coin generation' events could check to see if the variable is less than x and if so, spawn another coin.
Then, as the player collects a coin, decrement the count by one.