Review this MacIssues article: How to run and interpret Apple’s Hardware Tests on your Mac. Here is Apple's Error Code listing: Apple Diagnostics: Reference codes
So if we dissect your error: 4SNS/1/40000001:YPOR-6.571
4SNS: System sensor
Sadly, I can't find YPOR are you sure this is correct.
mmm... It sounds like you either have HD corruption issues caused by a Trojan running on your system. You clearly have some OS file issues here that need to be addressed. You should be careful what you download from the internet as some files are very harmful to your system MacBook Pro 8_1 is a known Trojan app!
Do you have a friend who has a Mac? What you want to do here is connect your system to his in Target Mode using either a FireWire or Thunderbolt cable.
What you want to do here is first make a backup onto an external drive also attached to your friends system so all of your apps & data that you can't recover from the Apps store are backed up. Before you do anything.
Try running a good antivirus app with the newest definitions file from your friends system. Then try running Disk Utility to see if it finds any errors with either permissions or the disk its self. Did anything show up? Were you able to get the drive clean at this point?
If you couldn't get the drive clean: The next step here is completely wipe your HD down and reformat it with Disk Utility running the Zeros & Ones test but you need the older version of Disk Utility in Mavericks or Yosemite. Apple for some reason pulled it from El Capitan (hopefully your friends system is the older OS). Was Disk Utility able to recover your drive?
Download a clean copy of the OS installer from the Apps store and run it to install the OS onto your system. Once done download from the Apps store the Apps you had. Don't restore anything from your external drives back up as its possible the files are infected!
Once you get to this point work with your system is it better? Run it for a few days and then tell us what you discover or if the problem comes back.
I'll walk you though the next steps once we know the system is stable.