Solved by ptrblck in post #4 
              
              
                That’s an interesting approach! 
Based on this, you could also create a “hook class” holding this internal parameter, which could be simpler than creating new modules: 
class ActivationHook():
    def __init__(self, name, every_steps=1):
        self.name = name
        self.every_steps = every_step…