I am going to suggest you dig a little deeper into the plugs and actually take them apart and look at the inside for corrosion also.
I had a brake issue that presented the same as you described. All of the terminals on the trailer end looked fine externally, but inside the brake terminal was corroded to the point that it was two pieces that would sometimes make contact but mostly not.
Also don't go replacing parts until they are diagnosed to be bad.
Do you know someone that would let you connect your trailer to their truck to try to isolate if the issue is the truck or the trailer.