glad to be help… I guess…
here is another idea, after explained what you want to achieve. delay node can help here. it looks ugly but no need a function node.
[{"id":"e69c797a.e2e748","type":"delay","z":"e967fc6e.96e16","name":"","pauseType":"delayv","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":400,"y":440,"wires":[["7fee3fd5.55009","b5eafa29.f043c8"]]},{"id":"873f45d4.d6c088","type":"inject","z":"e967fc6e.96e16","name":"","props":[{"p":"payload"},{"p":"delay","v":"2000","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":440,"wires":[["e69c797a.e2e748"]]},{"id":"7fee3fd5.55009","type":"debug","z":"e967fc6e.96e16","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":440,"wires":[]},{"id":"b5eafa29.f043c8","type":"change","z":"e967fc6e.96e16","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"msg.delay*2","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":540,"wires":[["e69c797a.e2e748"]]},{"id":"95bf33b3.23e6b","type":"inject","z":"e967fc6e.96e16","name":"reset","props":[{"p":"payload"},{"p":"reset","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":201,"y":389,"wires":[["e69c797a.e2e748"]]}]