Usually the underhood pin is a single wire that when the hood is raised it will connect the wire to ground. Easy way is to tap into that wire and run it to the back to the new switch.
I think
@Frankwhoa wants the factory vehicle alarm to sound if someone lifts his tonneau. Unfortunately the hood switch on these trucks do not set the alarm off, it is just to disable the remote start.
I was thinking the same thing when looking into adding a shock sensor. I had the hood open but the alarm didn't sound till I opened a door.
Someone posted a while back about adding this:
Megatronix UPS Add-On Shock Sensor To Factory OEM Car Alarm Security Systems
https://www.amazon.com/dp/B007VHG3BA/
It gets wired to the door switch, a pink wire if I remember correctly on the driver's door.