It’s the rare star who covers for his own understudy. But Lin-Manuel Miranda did just that when Javier Muñoz, his alternate in the hit Broadway musical “Hamilton,” missed a Sunday matinee.

Considering Sunday matinees are the only shows Muñoz plays, you may wonder what kept him away.

Blame it on cancer.

“I was diagnosed in October,” Muñoz tells The Post. “I spent about six weeks not wanting to think about it, face, it, deal with it.” Even now, he’d rather not say exactly what cancer he’s up against, only that “I had never felt fear before like this in my life.”

For weeks, the 40-year-old says, he said nothing. “I’d just call out [sick] or push through,” says the slender, goateed Muñoz, whose job includes observing every “Hamilton” performance for any new nuances, and to go on for Miranda if needed. (Good luck with that, Muñoz says: “Lin’s such a workhorse — if both his legs fell off, he’d wheel himself out there!”)

But in November, Muñoz did what he had to do: He left the show to undergo surgery, followed by radiation treatments that depleted him, then physical therapy to get him strong enough to take the stage.

More on this...

All told, he missed two months of Sundays, in which cast member Jon Rua often went on in his stead.

Click for more from The New York Post.