In the past few weeks, Terrapin men’s soccer goalkeeper Zac MacMath has had to get creative just to stay involved.

Largely unneeded in games where balls seldom reached the Terps’ penalty box, MacMath directed his attention elsewhere, focusing on how he would play, for instance, as a field player.

Against Colgate last night, the Terps’ chances of a win hinged on their All-ACC keeper. From the opening minutes of their game, the No. 3 Terps walked into a rude awakening of a midweek trap game. The Raiders attacked vigorously with dangerous crosses and swerving shots, handing MacMath his toughest challenge in weeks.

But led by MacMath, who finished with a career-high seven saves, the team avoided the upset with a 2-0 victory. For the second straight game, the Terps (10-2-1) started flat but found a way to win.

“It was a very poor first half for us,” coach Sasho Cirovski said. “I’m going to have to figure out what I did wrong in not having the team prepared to play well in the first half. I’ll take full responsibility for what happened in the first half.”

In those first 45 minutes, the Raiders (7-4-3) doubled the Terps’ shots, controlling possession in their attacking third and playing with a compact defense that spurred several counterattacks. Still, the Terps held a 1-0 advantage after a goal from Forbess in the 36th minute.

“Guys just weren’t sure why we were playing so bad,” MacMath said.

“We kept giving the ball away,” Cirovski said. “We were very, very poor with our possession. It just led to some quick counters.”

With his teammates struggling, MacMath seized the chance to help the Terps stay in the match. After finishing two of his past five games — all wins — with no saves, MacMath came through just when he needed to for the Terps.

“If you would have told me before the game that he would have a career high in saves against Colgate, I would have told you you were crazy,” Cirovski said.

MacMath again showed why he is one of the premier goalkeepers in the country, making several diving stops and point-blank saves.

“I made a save in the first five minutes,” MacMath said. “That really got my confidence up, so I just really tried to keep the team in the game.”

After a shaky beginning to the second half, the Terps calmed down and outshot the Raiders 14-4, including a Casey Townsend header in the 80th minute that found the back of the net for a 2-0 lead.

But it was Forbess’ first-half strike that started to turn the offense around before halftime. Gathering a deflection, Forbess faked a pass to midfielder Billy Cortes. With an opening, the midfielder struck a ball from the left side into the back of the net past diving Colgate goalkeeper Chris Miller.

“I was watching from the bench, and I just saw no energy,” Forbess said. “So I just wanted to come out with a lot of energy and talking.”

The Terps finished the night with an 18-13 shot advantage, but Cirovski still wasn’t pleased with how his team looked against the Patriot League leaders. Without MacMath, the Raiders could have easily ended the Terps’ win streak, which now stands at six games.

“He definitely came through tonight,” Forbess said. “They should’ve had five goals tonight, so it definitely feels good to have him back there when we need him.”

ceckard@umdbk.com