If the window or handrail is leaking that should be the first fix. The cabin side damage should be obvious when the window is removed. Hopefully it has not spread too far. The fix is to remove the wet core and replace it with new dry core using epoxy resin.
Living aboard in Victoria Harbour