Honda Foreman Rubicon 500 Issue

I have a 2004 Honda Foreman Rubicon 500 with issues with the Hondamatic transmission. I have found out the original issue as to why it stopped shifting in the first place which was that the rectifier (regulator) went bad, frying the battery and the ECM. I have replaced the computer but not the battery yet. It continues to flash code 5 (I do believe it had a code 4 before but I might be wrong, assume I am for the time being). I have erased the code but it comes back. Should I just replace the battery due to the fact that it is bad? Could it cause the code due to the fact that it doesn’t have enough voltage to send to the sensors?