Let's say you scan for the error every 5 minutes - you just set the treshhold for the notification to e.g. 3x that much like 15 minutes (aka. 900 seconds)
When sensor state is STATUS (DOWN/UP) for at least VALUE seconds, perform NOTIFICATION
When sensor leaves Down state after a notification was triggered, perform
The Treshhold tricker has a similar setting...
Your state is likely determined by a scan-interval - therefor X amount of time of the interval would be the best way forward, unless you use the API and send data to PRTG - where I tend to say change your code and add a channel or use the business process sensor or sensor factory sensor where you might be able to calculate it out...