Is it possible to switch an outputpin dependend on "stepperdriver active" or "was active

Is it possible to switch an outputpin dependend on “stepperdriver active” or “was active in the last 30 sec”? Goal is to switch a coolingfan to on only when the drivers are in use.

You can setup a switch to read any gcode, including those that other modules use. so you could set a switch to turn a fan on/off based on the stepper driver on/off gcodes.
There is no way to do this for when the steppers automatically turn on when a movement is requested.
If you have a smoothieboard you could do that by soldering a wire between a driver enable pin and a mosfet control pin ( all are broken out )