Neither the state nor any county of the state shall pay or be liable in any criminal case or prosecution for the fees, costs or mileage that may accrue in favor of any witness who, at the time of attendance as a witness before any court, grand jury or magistrate, resides within five (5) miles of the place where the person attends as a witness.