Glamorgan 171 for 8 (ten Doeschate 43) beat Essex 167 (Cooke 60*) by two wickets
Chris Cooke carried Glamorgan to a two-wicket victory off the last ball of a dramatic final over as Essex's third defeat in four games left them desperately needing to shore up a faltering season.
The South African wicketkeeper-batsman hit a four from Neil Wagner's final delivery to give Glamorgan their second Vitality Blast win of the season.
Cooke's masterly display of hitting brought him 60 from 29 balls, including four sixes and three fours, in a turnaround which included a stand of 61 for the ninth wicket with Timm van der Gugten from just 28 balls.
Adam Zampa had done his best to rein in Glamorgan and give Essex a second win with three for 17 from his four overs. The Australian leg-spinner had been the only Eagles bowler to come out with any credit from the heavy defeat by Surrey at the Oval the night before when he took two for 20.
Essex had been undone after being asked to bat when they suffered another spectacular collapses, losing their last eight wickets for 50 runs in just 40 deliveries, falling from 117 for two to 167 all out.
And that after an opening stand of 48 from 32 balls between Adam Wheater and Varun Chopra, and another between Tom Westley and Ryan ten Doeschate of 62 from 27 balls for the fourth wicket. The loss of Ravi Bopara to a suicidal run-out and ten Doeschate next ball for a 28-ball 43 that included three sixes, prefaced the rapid decline.
Zampa did not attempt to gloss over Essex's shortcomings He said of the third defeat in four games: "It's hard to put into words how disappointing that was. Two defeats in two days isn't great for momentum.
"It was a bit of everything. The batting, we lost wickets in clumps at crucial times. 170 here isn't enough. Then with the ball we'd done well taking wickets, but we were just losing the crucial moments, just some decision-making. There are things we need to get right very quickly otherwise the tournament is going to crawl away from us very quickly."
Zampa was not sure if Essex are a team short on confidence at the moment. He said: "I've only been here a short while so I don't know what the guys' characters are like. It's one of those things, it can turn around pretty quickly as well. If we can get the little things right, it's T20 cricket and you can get a bit of a roll on. But we're going to have to sort it out pretty quickly.
"We've got the skills, everyone playing at this level has got the skills, it's decision-making and the mental side of things.
Michael Hogan bowled four miserly overs for 22 runs and two wickets, and was backed by Graham Wagg's two for 30 at the height of Essex's misfortunes.
Glamorgan had made steady progress in their reply until Wagner was introduced for his Essex Blast bowling debut. With his fourth ball he had Usman Khawaja swishing at one down leg-side to be caught behind.
Colin Ingram, who habitually flays Essex with centuries, found himself tied up in knots by Zampa, and in frustration swept the Australian leg-spinner straight into Chopra's hands at backward square leg for just two. Zampa then did for David Lloyd, who played all around one and was bowled, He might have had a third but Chopra dropped a simple chance at deep square leg when Donald was 27.
When Bopara had Graham Wagg and Andrew Salter bowled in successive deliveries in an over that went for just two runs, Glamorgan were on the verge of suffering a collapse of their own. They were 107 for seven, still 61 runs from their target with 34 balls left. But then the fireworks began.
Craig Meschede gave himself room and was bowled to give Zampa his third wicket, his final over conceding just three runs. Cooke then took over. Suddenly 11 were needed off the last over. Cooke took a single off the first ball from Wagner, and Timm van Gugten a single off a wide from the second. Two more for Cooke reduced the target to six from four balls, then five from three, four from two and two from the last ball. A wide from the sixth ball tied the scores before Cooke hit the winning boundary to cow corner.