Either replace the end or the complete wire.
https://www.amazon.com/Molex-6-Pin-Connector-4-20mm-0165-Mini-Fit/dp/B07DLKJLMW
for illustration. May not be the exact Molex plug you need.