Hello Rotter,
Mister M's examples differ because they use they verb "to be", whereas your examples use the verb "to contest".
Thus the correct forms (for the context you intend) are:
1. If BB had contested the election, she would have won.
— the underlined part is the past perfect of the verb...