In the middle of August, when most college basketball players are in the middle of workouts preparing for the upcoming season, JayVaughn Pinkston was meeting with doctors, worrying his right leg might have to be amputated.

One morning, Villanova’s star junior forward couldn’t get out of bed, unable to put any weight on his right leg. He needed crutches to get around. His leg felt funny, like it was in a microwave overheated. Puss was oozing out of his calf and it was turning orange.

Doctors initially told him it was a fracture. It proved to be worse — diagnosed as Methicillin-resistant Staphylococcus aureus (MRSA), the dangerous staph bacterial infection that has spread through three members of the Tampa Bay Buccaneers.

“At first it was scary,” the Brooklyn product and Bishop Loughlin grad told The Post in a phone interview. “I didn’t know if I was going to lose my leg or not. I kept praying that I was going to be all right.”

Fortunately, the potentially deadly infection was found early enough to avoid long-term damage. Doctors initially made four small incisions into his right leg. But it didn’t eradicate the problem. Puss still was coming out of his calf. Emergency surgery cleaned it out, and at a recent checkup Pinkston was told he was MRSA-free.

“I’m concentrating on having a great season and being a great teammate,” he said. “It happened already. I can’t change it. Like coach always tells us, ‘next play.’ ”

Villanova coach Jay Wright joked the old Pinkston would’ve been happy to have MRSA, if it meant missing part of preseason workouts. But the coach thinks his star pupil has matured, the disease scaring him straight, making him appreciate his opportunity.

He went three weeks without touching a basketball, a lifetime for a hoophead like Pinkston, and he wasn’t able to practice with his teammates for more than a month.

The physical forward had been making progress, Wright said, and this was just another step in his development.

Sophomore point guard Ryan Arcidiacono has noticed a change in Pinkston as well.

He has a “different outlook on life in general,” Arcidiacono said. “It humbled him a little bit. He took steps off the court to being a better person now that he’s been through it.”

The 6-foot-7 Pinkston is coming off a breakout sophomore season in which he led Villanova in scoring at 13.3 points per game and posted the eighth highest free-throw rate in the country last season, according to KenPom.com, finally living up to the potential he arrived in Philadelphia with as a McDonald’s All-American.

Pinkston was suspended from school for the spring semester of his freshman year in 2010 for a violation of the student code of conduct, after he was involved in an off-campus incident with two other fellow students and charged with simple assault and harassment.

He was readmitted in June of that year and is on pace to graduate next year. The incident reportedly was expunged from Pinkston’s record after entering the Accelerated Rehabilitative Disposition program.

Selected as a preseason second team all-conference honoree at Big East media day on Wednesday, Wright said Pinkston’s game has become more well-rounded. Despite the MRSA scare, he said he’s in the best shape of his life, his jump shot has improved and is handling the ball better on the perimeter, while still being a load in the paint with his chiseled 240-pound frame.

“He’s just a matchup nightmare,” Arcidiacono said.

“He dominated portions of games [last year] and then he would disappear a little bit,” Wright said. “I want him to be consistently dominant on both ends of the floor. That’s a challenge.”

Wright thinks Pinkston has NBA potential as an undersized small forward if he continues to improve and evolve as a player.

The future, however, isn’t weighing on Pinkston. He’s focused on the present, leading Villanova back to the NCAA Tournament. He figures everything will work out as long as he puts the effort in. His bout with MRSA taught him to appreciate what he has, and make the most of every moment.

“It was just an eye-opener,” Pinkston said. “Anything can happen at any given time and anything can be taken away from you.”