The Blues led at half-time thanks to Jamie Grimes’ thumping finish on 35 minutes.
Josh Umerah slid in an equaliser just after the break but Town retook the lead with 22 minutes remaining when substitute Joe Quigley smashed home from 20 yards for his first goal for the club.
The win is Chesterfield’s first in five and keeps them fifth in the league and they have extended their lead over the teams just outside the play-offs.
Cook said: "It was a must-win game, if you like, and we did. The reality is we are delighted, simple as that.”
On the performance, he added; "We do some really good things and we do some really bad things. Sometimes our decision-making processes are probably not what we would all like them to be but we have got such a good honest bunch of players it is untrue. It is as good as I have had, I have to say that.
"I don’t doubt this team in terms of honesty or work ethic. I question some of our decision-making and some of the madness we do but that is for another day. I enjoy working with them and their honesty shines through.”
Cook changed formation to three at the back, including recalling Gavin Gunning, and the move paid off.
"The problem at the minute is that we probably don’t know our best team,” Cook explained. “There are not many teams going into the play-off areas now that don’t know their best formation and team – we don’t. We are searching for it and today we have come to a difficult place and won so it calms everyone down a little bit.”
Tom Denton also came into the starting line-up, his first start in 15 months after two knee injuries. The striker played 60 minutes before being replaced by Quigley.
On Denton, Cook said: "He is a great lad. He just gives you everything that he has got. And in the final third in both boxes he is nearly unplayable at times but you have got to adapt your style to that.. If we are going to play Tom we have got to hit him a bit better and we have got to have energy around him that can run past him.”
Manny Oyeleke was not involved in the squad despite playing half an hour against Grimsby last weekend.
"We need to get some training days under his belt,” Cook added. “We can’t keep putting him and out. It is unfair on Manny and unfair on us. We have got a real quality player in the building and we have got to build that fitness up.”