well i dont know how to maximize the battery life but i know how to calibrate the mac battery
charge the battery fully wait 2 hours run the MacBook for an example in battery until it goes to sleep ,wait 5 hours, charge it fully again
you can if it is a uni-body not a white one and yeah u need to replace all the upper case for that and it's gonna take sometime for you to change it but believe me it's worth it ;)
Open the MacBook and try to clean it with an alcohol liquid called Spirto ..this thing the women use to clean there finger nails ,,,,and let it to dry for at least an hour dont try to turn in it on before clean the keyboard and the mouse and the cables and motherboard not all of it only where the mouse and keyboard are plugged and i hope it will work if not...u need a new upper case
first u need to check all the cables if they were plugged correctly (try to unplug and plug them back) if not search for any scratched cables
but in my view its a cable problem
if the cables are plugged in correctly then its might be a logic board problem