What kind of FSM is it, if outputs depend on internally generated signals?
The counter value is actually part of the state of the machine. Everything that is stored in a flip-flop inside the machine and has the potential to change the behavior of the machine is its state.