If you're fine with immediately and continously getting max health while in water (kinda like the original game, heh?) you could add a condition to the max health code - the challenge of course will be finding an appropriate condition (if you play the N64 version with debug display enabled you can see your current "action number" and some apply to swimming, but it's no guarantee they will be the same on the DS version)
Another option is completely removing the health penalty while underwater by removing the appropriate code from the game (technically possible with codes since DS games don't run directly from rom, but added complexity and other limitations...)
Again the hard part, without a fully commented disassembly already made and posted to github, will be identifying the code that does that...
(
An educational video about how it is implemented on N64, knowing the address of the health value from the existing max health code, assuming it still works on to-be-added and to-be-removed variables like the original version [is there a "don't take damage" cheat separate from the max health one?] and the values involved, and an emulator or equivalent with memory read/write breakpoints and cheat search - those things will probably be enough to find a solution but it won't be trivial especially for the beginner