Every person charged with the performance of any duty under the provisions of any law of this state relating to elections, including primaries, or the provisions of any charter or ordinance of any city or town of this state relating to elections who willfully neglects or refuses to perform such duty, or who, in the performance of such duty, or in his or her official capacity, knowingly or fraudulently violates any of the provisions of law relating to such duty, is guilty of a class C felony punishable under RCW
9A.20.021 and shall forfeit his or her office.