Before Daniel McCabe defied the odds and got a new liver, his parents braced themselves for months of exhausting hospital visits to try to keep their infant alive.

The 4-month-old's life was an endless parade of weekly blood work, interspersed with mad dashes to the emergency room when his condition deteriorated. By December, Melody and Joseph McCabe just kept an overnight bag in the car, ready for the hospital.

Through it all, they saw proof of the disease that threatened to kill their son — Daniel's skin remained a sickly yellow hue.

He'd been that color since he was born July 20. The discoloration was caused by an excess of bilirubin, a yellow pigment of red blood cells, according to the Mayo Clinic. The discoloration usually happens because a newborn's liver isn't mature enough to get rid of bilirubin. Most often, it can be treated with noninvasive therapy, or it simply goes away on its own.

But Daniel stayed yellow. He was diagnosed with biliary atresia, in which bile from the liver never makes it to the gallbladder, damaging liver cells and eventually killing the organ.

Slowly, his liver turned to scar tissue the consistency of wood, said Riccardo Superina, one of Daniel's doctors. The baby's condition weakened his bones — just holding him could fracture his ribs.

“Daniel could not have survived another three or four months,” Superina told The Washington Post.

Desperate, the McCabes attempted a stopgap surgery that works in many children with the disease, hoping it would buy Daniel more time.

It didn't. His skin remained yellow. And it was all but certain that Daniel would go on the liver transplant list, the next phase in his saga — and one of his quickly dwindling options.

That's why on Dec. 13, Melody McCabe was sitting in a hospital room in Chicago, waiting for lab results. Getting on the organ donor list would be good news, but it didn't mean an easy road. The average wait time was 86 days — nearly three months, during which the McCabes would have to do everything in their power to keep Daniel alive. The weekly blood work. The mad dashes to the hospital.

The most dangerous time for babies like Daniel is when they're on the transplant list. And the longer he waited for a healthy liver, the less the doctors could do on one of those emergency trips to the hospital. Children Daniel's age have the worst odds, doctors say. Many babies die waiting.

This is what McCabe mulled at Lurie Children's Hospital of Chicago as she waited for the doctor to arrive with the results of Daniel's lab work.

Then the doctor walked in.

“He was quiet,” McCabe recalled. “Usually, that means bad news. But he said, 'We have a liver.'

“I didn't even know he was on the list yet.”

Officially, according to the hospital, Daniel was placed on the United Network for Organ Sharing's registry at 10:15 a.m. on Dec. 13. By 10:55 a.m., a liver had become available.

The short wait time is extremely rare, according to the hospital. Six thousand people receive a liver through UNOS each year. Daniel is one of 43 people — one-half of 1 percent — to have waited less than 40 minutes for a match.

“It was a combination of factors, including the organ’s availability, size and correct match for Daniel’s blood group,” Superina said. “It was really a matter of luck.”

Daniel had organ transplant surgery the next day.

After the transplant, Saeed Mohammad, another of Daniel's doctors, checked the lab work, he told The Post. A normal bilirubin level is 1. Before the surgery, Daniel's was a dangerously high 38 and “he was as green as Kermit,” Mohammad said. Afterward, his number dropped to 4.

Over the weekend, doctors removed the nasal-gastric tube they'd been using to feed the baby. All the signs were positive.

“It's very good, once there's a transplant, although it's not 100 percent smooth sailing,” Mohammad said about Daniel's prospects.

But Melody said she could tell things were better soon after Daniel got out of surgery.

“This is the first time I’ve seen him with normal skin coloring,” she said. “He’s always been yellow . . . So to see him with normal coloring is just amazing.”

Read more: 

‘This little kid’s been shot’: 911 call reveals frantic attempts to save road-rage victim

‘There’s lots of questions why’: 8-year-old dies after tombstone falls on him

Boy building snow fort dies after he’s trapped in snow bank

‘Kids, there is no Santa’: Pastor unloads on families waiting to take Christmas photos at a mall