There are two ways to solve it,
-
Use custom action where you use timedelta of datetime module to get time difference and send a response if timedelta threshold is more than 4 sec. You need to trigger it using stories or rules.
-
If you have your own custom frontend, you can do the same inspite of sending to rasa.