I can't Reverse Engineer what you have, so that will remain an unknown to me. No worries, because 2nd Battery 'stuff' is easily found on the Web. Also, RVers do this sort of thing all the time. The 2nd Battery [or Bank of Batteries] is in the Trailer. Charging that Battery is what existing Truck Wiring back to the Rear Bumper 7 Pin Connector is typically all about.
Charging a Trailer 'House' Battery is nice because then you have maximum Boondock time when you set up Camp. The Truck Alternator won't overcharge a House Battery. For those who plug in at RV Parks, the built-in Trailer Charger keeps the Battery charged up.
Here's a bunch of Schematics to choose from. At RV Stores, there's 2 Battery Switches readily available that can handle the high current. Some of us automate this function and charge while driving. A hefty Relay to direct Alternator Current to the 2nd Battery [in the Trailer or in the Truck] can be wired to disconnect once the Truck is turned off. A key benefit is to keep from discharging the Truck Battery accidentally after Boondocking in remote areas. The Relay Coil on such a hefty Relay is energized from some 'Ignition On' Wire that's live only when the Motor is running. Some Folks manually override this function. They charge their 2nd or House Battery for 'x' driving time, and then switch back to charging the primary Truck Starting Battery.
A very common mistake is to under-size both Battery Charging Wiring and Trailer Brake Wiring. I'll likely upsize both these Wires in my new Truck. Factory Wiring is 'ok', but is not ideal.
Dual Battery Schematics & Search Results
Dual Battery Switches & Search Results
An important detail is to NOT switch a running Alternator between 2 Batteries. This can
cause damage. It's all dependent on exact Vehicle Alternator details, and the nature of the Solid State Control used.