If it's the barrel connectors that have come apart, twist them to put them back together. There are 2 of em. Then put hose clips round them (secure but not over tight) un use strong tie wraps. Be careful not to tie wrap the cable un pinch it as that’ll cause the cable stress un damage. Replacement parts? Auto gearbox harness one side, which I think comes wiv the auto. T’other side is part of a wiring loom. Mine are as above in the pic.
The struggle to pull away is the default into 4th gear. Hence the F4 flashing. Essentially you've either lost the electrical connection to some of the sensors, or/and the solenoids. The sensors tell the phooter what’s happening, un the solenoids convert electrical energy into mechanical energy, to change gear – by hydraulics.
Look at the connectors first. It could be a wire is snagged un shorted to metal work earth also. A transmission fluid change has known to work wonders on the Jatco auto (what yer has) but try the connectors first. This is the most popular fix for this problem.
Have swapped me pic above for a betterer version from me betterer camera. Ere it is again.
Edit: well it will show when the feker updates on photobucket.