You can share currentTime. You need a second startTime variable for point 4 in reply #4. Change the name of your current startTime to e.g. startTimeSensordelay (ok, it's a bit long but it reflects exactly what it is) and add a second variable startTimeFandelay that you use for the fan.