Z Axis Issues drift and strange noise

I’ve been having strange things happening with my z- axis as of late. I’m in the process of upgrading to the 30x48 from the 30x30. Was trying to get new spoil board ready before tearing my machine apart. I have a t-track system and 7 piece of MDF of one size and two of another size. I cut 6 of the 7 exactly as expected (very simple g-code) and on the 7 cut the z-axis just started going nuts like it was lost. Cancelled the job but up was down in the Z and machine didn’t sound right. Rebooted machine and g-sender a few times before things returned to normal. I’ve had strange things like this before where the z-axis just starts plunging into the work. As I was finishing up my conversion to the 48x30 I noticed one of the z-axis motor connectors pins was darkened which makes me think I had some sort of short or over current condition.

Any ideas? I guessing I need to replace the stepper motor and or motor cable?

I’d replace both ends of the connector. Looks like it developed some high resistance and heated up.