I just did this kind of fix on my '04 12r. There is a plug under the fairing. This plug has only 3 wires. The ground is factory spliced and split in the harness between the headlights and the bike. So both headlight share the same ground. There are a couple of options to fix it.
1. But a new headlight harness. (Ebay, St. Paul Harley)
2. Build a new headlight harness. The plug and pins can be found on Digikey. I can't remember the part number off the top of my head. This is the route I took.
3. Almost the same as 2, but fix the factory splice.
4. Find a new ground point, and re ground the headlights.