LOS ANGELES — An NBA coach once told me that one of the most frustrating parts about his profession is that when you finally stop one hole from leaking, another one tends to open up.

That’s where the New York Knicks are now — a team playing whack-a-mole with its own destiny as the postseason nears.

The Knicks have upped their defense as of late. They went from having the NBA’s 17th-ranked defense through the first 40 games to having the top-ranked defense over their last 26 games. As that’s been happening, though, New York’s offense has taken a bit of a slide, going from the NBA’s fourth-ranked offense to the 10th-ranked offense over the same period.

It’s still a good offense, but the Knicks certainly haven’t been as potent on that end of the floor over the last two months. It was the offense, primarily the turnovers and long stretches of missed shots, that lost them back-to-back games in Los Angeles to the Lakers and Clippers earlier this week.

Is there a correlation between the improved defense and declining offense? Coach Mike Brown doesn’t tend to think so.

“Three games ago against Denver, we played well defensively and knocked down open shots,” Brown said after his team lost to the Clippers on Monday in a game where the bench went scoreless for the first half, and the team had 20 turnovers.

The main factor why the Knicks’ offense hasn’t looked quite the same as of late, as simple as it sounds, is the poor 3-point shooting. Not only have the attempts decreased, but the efficiency has dropped, as well. This team is 7-15 when it shoots under 35 percent from 3 this season.

Over the first 40 games, New York ranked third in the NBA in 3-point percentage and seventh in attempts. Since then, the Knicks are 10th in percentage and 13th in attempts. A handful of players have seen their shooting numbers dip after a strong start to the season, like Jalen Brunson, Mikal Bridges and Josh Hart, all of whom have had their 3-point percentage drop down to the mid 30s or lower over the last 26 games. Teams have continued to dare Hart to shoot even though he spent the bulk of the season knocking down 40 percent of his 3-point looks.

The Knicks, though, are still generating good attempts from distance. They’re shooting even more corner 3s and fewer above-the-break 3s on a nightly basis over the last two months in comparison to the first 40 games. Yet, the efficiency of both has fallen to 36 percent and 31 percent. To dig even deeper, New York ranked third in “open” 3-point attempts per game through the first half of the season and still ranks third in that department over the last 26, per NBA.com.

However, the Knicks have gone from ranking third in efficiency on those shots to 15th. The team has even taken more “wide open” 3s per game over the last 26 than through the first 40. The efficiency has declined there, too.

Not having the sharpshooting Miles McBride, who is sidelined indefinitely after having core muscle surgery, for the bulk of these games has hurt the Knicks’ shooting, as has the addition of Jose Alvarado. Alvarado brings a lot of good to the table, but he has never been known for his shooting touch. Since being added at the trade deadline, Alvarado has taken the fifth-most 3-pointers on the team and is making over 27 percent. That has hurt New York at times when the defense isn’t perfect.

Brown is huge on “sprays,” which he defines as a player having the ball in the paint — whether by a drive, offensive rebound or other — and kicking it out to the 3-point line. The Knicks have improved over the 26 games when it comes to paint touches, jumping from 25th during the first 40 games to 14th over the last 26. They’re just not capitalizing with the same efficiency from distance on those drive-and-kick opportunities, as noted in the regression from behind the 3-point line.

“Simply put, we just have to shoot better,” said Karl-Anthony Towns, who is one of the few players on the roster whose efficiency has improved lately. “The last two games, we’ve done a great job of giving ourselves chances to win games, but we just haven’t shot well. Then we weirdly shoot well at points in the game to give ourselves a chance. It’s just sometimes how the game goes. We just have to stay confident.”

Part of why the Knicks have seen such a decline shooting the ball might be a combination of tired legs, continued slow pace and personnel. Not to make excuses for New York, but I’m fairly certain no team in NBA history has traveled as much as it has before the postseason. The Knicks did a preseason tour in Abu Dhabi. In December, New York won the still-fairly-new NBA Cup, which added a third lengthy trip to the Pacific Time Zone this season when most Eastern Conference teams just have two.

As for the slow pace, all season long, New York has been near the top of the league in shots taken very late in the shot clock (between four and zero seconds) and late in the shot clock (between seven and four seconds), per NBA.com. Even when the offense was humming, this was the case. Combine tired legs with rushed shots, and this is what you get.

Lastly, New York’s lack of ballhandlers (outside of Brunson) who can break a defense down off the dribble, get to the rim and/or create advantages is a big reason why it can look like a chore for the Knicks to score when they play in the halfcourt against physical defenses.

Defenses are also more frequently trapping Brunson lately. Before Jan. 5, Brunson was blitzed on just nine percent of his pick-and-roll actions. Since then, that number has improved to 12.5 percent. Opposing teams are not only trying to wear out the All-NBA guard but also force others to beat them. The results have been a mixed bag because of the lack of ball-handling and regression in shooting. In the process of blitzing Brunson more, he’s been forced to make passes over bigger defenders, which isn’t always easy for someone of his physical stature to do.

Brunson, more often than not, has made the right decisions when being blitzed, but there are times it has led to high turnovers and forced him out of a rhythm. When Hart is the screener, he’s able to roll and help unlock the offense as a passer and good driver, but the team isn’t capitalizing on those kick-out opportunities as much lately.

“The way teams have been playing me, I’ve been able to stay aggressive,” Brunson said. “When they put two on the ball, someone is open. While we’re not trying to give in to what they do, we’re still trying to be aggressive, make plays and make life easier for everybody.

“When I get into the paint, I’m trying to make plays and stay in the paint, whether it’s for me to shoot a floater, a turnaround or see someone open — a lob, someone in the corners or someone filling in at the top of the key. I’m just trying to make the right play at the right time, the best I can.”

This version of New York has some 2024-25 Boston Celtics vibes this season, meaning if the jumpers aren’t falling, things can get ugly.

If the Knicks could combine the offense from the first 40 games with the defense from the last 26, they’d be talked about as the best team in the NBA, as opposed to the inconsistent team that they’ve shown to be since the top of the calendar year. That, however, is what makes the journey worth monitoring. When something appears fixed, something else breaks down.

The goal is to have all the parts in sync come the playoffs.