Help on Game_Timer-based switches

Any advice (or just a whole solution if you want) on making a small script snipplet for Game_Timer that will turn a switch ON if @count > 180 && @count < 240, else turn the switch OFF? (of course the numbers will vary)

#-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update if @working && @count > 0 @count -= 1 time_section_check on_expire if @count == 0 end end
Code:
class Game_Timer    def time_section_check    if @working && @count > 0      if @count > 180 && @count < 240        $game_switches[83] = true      else        $game_switches[83] = false      end    end  endend 
Edit: I managed to get it to work by making this a definition and then calling this function upon def update.(changed the <code> above)

This thread can be closed.

Original thread: https://forums.rpgmakerweb.com/threads/help-on-game_timer-based-switches.17921/