James had 26 points, 12 assists and nine rebounds, while Dwyane Wade and Mario Chalmers each scored 25 points for the Heat — who took a 3-1 stranglehold on the best-of-seven championship series with a 104-98 victory over beat the Oklahoma City Thunder.
The Heat, who won the title in 2006, can win their second championship in franchise history with a victory in game five on Thursday in Miami.
With James on the bench after appearing to injure his left leg in the fourth, Chalmers helped secure the victory with a layup with 44 seconds left that made it 101-96.
The victory spoiled a brilliant offensive performance by Thunder guard Russell Westbrook, who finished with a game-high 43 points.
Kevin Durant had 28 points for the Thunder, who got off to their best start of the series in the first quarter but couldn't execute as well as the Heat down the stretch.
James nailed a three-point shot to break a 94-94 tie late in the fourth. The basket came about a minute after he had re-entered the game, having injured his left thigh earlier in the quarter when he slipped on a drive to the basket.
He was then forced to sit out the final minute of the game after being stricken with painful leg cramps that sidelined with just 55 seconds to go.
"It is like your body just shuts down, your legs shut down on you and there is nothing really you can do about it," James said.
The cramps started with about five minutes left and he had to leave the game for treatment on the sideline.
Even though the pain wouldn't go away, James returned briefly to the game, and on one leg he managed to nail the crucial three pointer to give Miami a three-point lead with 2:51 left.
"The ball was swung to me and the shot clock was going down," James said.
"I just wanted to step up and make a play. I was able to drain the three and give us a lift. If I was on the floor I wanted to try to make a play with the limited mobility I had at the time and I was happy I was able to come through."
The Thunder have a huge mountain to climb as no NBA team has ever come back from a 3-1 deficit in an NBA finals.
The Heat were down by 17 points in the first quarter of game four Tuesday but they didn't fold, going on a 13-0 run to start the second quarter to quickly bounce back.
In last year's final, Miami lost game four in Dallas, kicking off a three-game slide that cost them the title. But this is a much tougher Miami team, one that can win those battles of attrition that would have doomed them last season, said forward Chris Bosh.
"I don't think we would have won a lot of these games a year ago," Bosh said. "We were the ones who had the lead last year and we couldn't capitalize. That was the biggest lesson for us because we really learned that we had to play right to the end of games."
With LeBron going down or somebody going down it can look bad, but those are the things you have to fight through. We just have to continue to meet the challenges and beat them."
Follow us @SprtNationalUAE