Use event listener to set value of status

I’m currently working on a custom implementation of camunda modeler, and I’m trying to set the status based on the task.execution status variable, which I’m trying to do in save-task.js. This is called by the event listener. Is there a best practice way of getting the current step value by the task execution variable? What I mean is, if I want to access the global variables within the modeler.