Check the signal at its source
Code P0305 describes a condition in the ignition system for the affected cylinder for cylinder five: the circuit is not reporting a plausible signal to the control unit. That names where to look, but it does not by itself confirm which part has failed.
How to tell the paths apart: Read the live data and compare it against the expected range for current conditions before replacing anything.