As others have noted, you need to consult an attorney, because this is a legal question. Also as others have noted, a HELOC is typically secured by a deed of trust, almost always in junior position to other debt. There is recent Washington case law holding that foreclosure by a first mortgage does not release the unpaid debt on junior mortgages, but that doesn't mean you don't have any defenses. You should have an attorney review your HELOC paperwork.
As to your comment about a house being sold, it would typically be difficult to sell a house without paying off or otherwise dealing with the HELOC. If that happened somehow, that also would be something to talk to about with an attorney.
Finally, collection agencies probably don't do what we think of as loan modifications (I've never heard of that), but what they will do is set up payment terms and compromise debt. They're all about collecting debt, and sometimes that means accepting pennies on the dollar. Something else to talk to that attorney about.