Basic understanding: how to create JS actions

You can import any JS file as a script in Drafts which does make this fairly easy.