An affirmative defense to ... a criminal charge is a fact or set of facts other than those alleged by the plaintiff or prosecutor which, if proven by the defendant, defeats or mitigates the legal consequences of the defendant's otherwise unlawful conduct.