I've put a lot of time and money into my 02 F150 5.4L Triton. The truck has a bad idle, and no power…

I've put a lot of time and money into my 02 F150 5.4L Triton. The truck has a bad idle, and no power when it's cold or hot. It has a new intake man. Plugs, COPs, MAF, Fuel filter,and many codes. PO171, PO340, P1406, PO303, PO308, PO316, PO122, PO401, & P1152. I've been pulling my hair out trying to find what would make the truck chug while idling and driving. After I put the new MAF in it runs worse and has times where it seens to want to take off for just a split second but goes right back to having no power.
Can you give me any ideas on what I can go after next. The truck has 316K and I got it for a good price.
Thanks for your time.
David

false