(a) In any criminal action pending before any justice of the peace court, where the defendant is charged with any offense of carrying weapons unlawfully, unlawful sale of or being interested in the sale of intoxicating liquors, or gambling, by affidavit or otherwise, and pleads not guilty and secures the services of an attorney to represent him at the trial, it shall be the duty of the justice to cause the prosecuting attorney or deputy for the county to be notified of the nature of the charge and of the time and place of the trial.
(b)
(1) The prosecuting attorney shall attend and prosecute in behalf of the state.
(2) In case of a conviction, the prosecuting attorney shall be allowed the same fee as is allowed for similar cases in the circuit court. However, no prosecuting attorney or his deputy shall receive any fee unless he personally appears and prosecutes in the case, nor shall any court tax any fee where such officer does not appear and personally prosecute.