Create an event that 'thinks' on interval

I don't want to use MV's GUI for inputting a 'script' that 'repeats'. I'm building my game mostly using code, so most of my work will be done in the form of a complex plugin. So in JS, how would I tell a given event to repeat the method "Hello world" every 15 seconds, for instance? Bonus points if I can call start the repeating method with StartIntervalThink( interval ), and use OnIntervalThink() to say what happens when each interval fires. (I understand generally how this works with JS, but I'm only just starting with MV's existing API)

(I'm trying to build a 'plugin' that is actually an intuitive library that teaches newcomers expert coding processes. Will be assisted by some YouTube videos)
If "Total Game Time Seconds" equal or more than VariableX
do: VariableX set to ("Total Game Time Seconds" + 15)
execute all the fancy code
else
nothing

The Condition would still be checked up to 60 Times per second but the
whole codeblock would only execute every 15 seconds.
Not sure if this helps here.
Nice! I'll give this a stab and come back with the code once it works.

Original thread: https://forums.rpgmakerweb.com/threads/create-an-event-that-thinks-on-interval.144108/