Sorry for the late reply.
Thank you so much for the help, this was very easy to follow.
The one thing I'm not clear on is how to call isEventActive()
I'm guessing that I would use the getMaintenanceEvent(xid)
from here: https://github.com/infiniteautomation/ma-modules-public/blob/main/Maintenance Events/src/com/serotonin/m2m2/maintenanceEvents/MaintenanceEventsDwr.java#L52
Something like this?
//To toggle off
var maintEvt = getMaintenanceEvent("MNT_123");
if (maintEvt.isEventActive())
toggleMaintenanceEvent("MNT_123");