; or (B) engaged in fraudulent, unfair, deceptive, or abusive conduct with respect to the debtor or the case. (4) Subject to paragraph (6), in a successful action under paragraph (1)— (A) the court— (i) shall award to a discharged debtor injured by a violation of subsection (a)— (I) actual damages, including damages for emotional distress; and (II) reasonable costs and attorneys’ fees; and (ii) if the trustee or the United States trustee is a prevailing party in the action, shall award to the trustee or the United States trustee— (I) reasonable costs and attorney fees; and (II) a fee equal to 3 times the amount sought to be collected by the person found to be in violation of subsection (a); and (B) the court may award punitive damages, as appropriate. (5) (A) If the court awards punitive damages under paragraph (4) in an action brought or joined by the trustee, the court may award between 10 percent and 25 percent of the punitive damages to the trustee who brought or joined the action. (B) Any punitive damages under this subsection shall be in addition to the compensation set out in section 326. (6) If the commencement or continuation of any action described in subsection (a) was taken by a person in the good faith belief that subsection (a) did not apply to the debt, and the action was withdrawn upon discovery that subsection (a) applied to the debt, the recovery shall be limited to actual damages, including damages for emotional distress, and reasonable costs and attorneys’ fees. (7) Nothing in this subsection shall be construed to prejudice the ability to bring a motion for contempt of court for a violation of subsection (a). (8) An agreement between a holder of a claim and the debtor, the consideration for which, in whole or in part, is based on a debt that is dischargeable in a case under this title is voidable by the debtor. (9) Any pre-dispute arbitration agreement or pre-dispute joint-action waiver regarding an action under paragraph (1) is voidable by the debtor.