How to multiply a sensor data

What I would like to achieve.
As long as a sensor is triggered (light switch), take that time, and multiply it by x. Max duration should be xx minutes, but that also be added directly on the Shelly.
My goal:
If you go to the toilet, and just make the “short” thing, for example, 1 minute, the fan should run that time x3 = 3 minutes.
If you go and have a big fight dumping “things” for 5 mins, then the fan should run for the amount x3, so 15 minutes.
As I am a newbie I have searched the web to find something similar but was not able to find it…
Thanks!

I like the ‘odd’ thinking :slight_smile: but it seems a bit overkill, why not have 2 … one for short and all others long.
EDIT: diff between long and longer does not have to mean more fan-time needed :slight_smile: else best is a air-particle meter (more overkill than above)