Sort of random question

Every time the trigger triggers increase a counter. When the trigger is triggered, check using if the counter’s value is less than 3, if so, trigger the trigger again. If not, reset the counter.