first i would put a voltmeter on the battery while at idle to see actually voltage because mayber your voltmeter in dash is a little off and you really do have a engine problem.

if voltage is 13.5 or more i'd say its not a charging problem.

if its really only 12 or so then you would then check voltage starting at the battery back towards the alternater and might find a bad connection or wire.

I had a bad charging wire in the wire harness on a previous boat i needed to replace

just my 2 cents