Some of that wiring looks like some of the core wires have been broken. You really need good electrical flow in these wires & connectors. I think one of the problems is the acute turn the wires make coming off that junction box. My bike has had some modifications & work done in that area. I removed the piece of steel bracket that holds those junction boxes. I can't remember if you need that bracket for anything else, but I don't think so. If you can reduce the pinch & curve in the wires, you can straighten them out & work on them easier.
Pick out the junction box that has the worst wire. Disconnect the junction box. Look at the back side of the plastic junction box & see how the wires are arranged. Make a sketch of what color wire goes in what hole in the junction box if you need to, or take some pictures. Gently pull that really bad wire out of the back of the connector & then trim back the wire to a good clean core of wire & re-solder the connector back on. Then return it into the junction box. If you don't have the soldering equipment, you are just going to have to repair what is left & insulate it. Heat shrink tubing will be the easiest & cleanest repair. Electrical tape is a last resort, but works just fine usually.
Sorry that I can't think of much more that will help you.
Good luck
J.