Pitch detection when successive notes are the same
Usually, the envelope of a note will decay.  A new note pluck will start (add or replace) a new amplitude envelope with an attack transient.

So you might add envelope tracking to your spectral frequency analysis (which may or may not be appropriate for correct pitch estimation).