Forgive me if I'm missing something obvious, but can't you just put in a bunch of extra empties in the sequence, and add a timed reset with the spell's cooldown? Instead of trying to precisely count how many commas you need based on how many times you think you're going to press the button