def decrementTimer(state): timer = state.scaredTimer if timer == 1: state.configuration.pos = nearestPoint( state.configuration.pos ) state.scaredTimer = max( 0, timer - 1 )