Cable connector order causing USB to break
How about something like this:







simulate this circuit &ndash; Schematic created using CircuitLab

The relay simulates your connector mating and un-mating.
You may need to tweak the R &amp; C values a little, depending on the P-MOSFET you choose.