Bill Cosby will be back in a Pennsylvania courtroom Tuesday morning, hoping to convince a judge who has dealt him blow after blow that 13 sex-abuse accusers should not be allowed to testify at his upcoming trial.
Prosecutors say the women were drugged and molested by Cosby and that their accounts show a pattern of behavior. Cosby's attorneys have cast doubt on the women's memories and motivations.
It will be up to Montgomery County Judge Steven O'Neill to decide whether a jury gets to hear from the women, whose allegations span decades, after listening to arguments from both sides during a two-day hearing.
More from NBC News: Cosby's Entire Trial May Rest on This Case Law
Wes Oliver, the criminal justice program director at Duquesne University and an NBC News analyst, said the ruling will be the most important one yet.
"That's the whole case right there," Oliver said.
RELATED: List of Accusers Against Bill Cosby
Cosby is charged with drugging and sexually attacking Andrea Constand during an encounter in his Pennsylvania home in 2004. It is the only criminal case stemming from dozens of accusations of sexual misconduct — all of which he has steadfastly denied.
Because there is only one accuser in the case, the prosecution's success could depend on whether the so-called "prior bad act" witnesses are allowed to take the stand.
"Let's say you can get a jury that's never heard of all these allegations against Cosby. Who do they see? Mortimer Ichabod Marker from 'Captain Kangaroo,' the guy from 'I Spy,' Cliff Huxtable. I remember when the allegations came out someone saying, 'Going after Bill Cosby is like going after Santa Claus.'
"Bill Cosby against one woman when the standard is reasonable doubt? Cosby has a really good chance of winning that," Oliver said. "But once you introduce into this mix that there's a good chance he's done things like that before, the jury starts to think there's a really good chance he did it this time, too."
More from NBC News: Bill Cosby's Accusers Hope to Testify at His Sex Assault Trial
Many states and the federal government subscribe to what's called the "lustful disposition rule," which allows accusations of prior sexual misconduct to be used against someone charged with a sex crime, Oliver said.
Pennsylvania is not one of those states and instead evaluates whether prior sexual misdeeds show a defendant has a "common plan" or strategy in committing sexual impropriety. If the court decides the defendant does, the earlier accusations can be admitted.
Oliver said courts in all states, including Pennsylvania, are more likely to admit prior acts than keep them out of a case. And O'Neill has already ruled against Cosby several times, including a recent decision to allow prosecutors to use his deposition in a civil lawsuit filed by Constand in which he talks about giving Quaaludes to women for sex.
RELATED: Bill Cosby through the years
Cosby has also tried unsuccessfully to convince the judge that a former district attorney who didn't charge him in 2005 promised he would never face charges and that he is too blind to assist in his own defense.
Of the 13 women who have agreed to testify against him, all but two have previously gone public about encounters with him. Seven allege that they consumed spiked drinks; six say they were given pills before being assaulted.
They were not named in the government's motion, but the defense identified them, leading prosecutors to accuse Cosby's lawyers of trying to intimidate the women. The defense also failed and tried to get the court to order competency hearings for the women.
One of the potential witnesses, Donna Motsinger, has told NBC News that when prosecutors asked if she would testify, she didn't have to think it over.
"I said yes and I didn't hesitate at all," Motsinger said in September. "If there's any way I can bring some kind of closure for all these victims, what kind of a person would I be if I said no?"