Trump has repeatedly said that all the ways he avoided paying taxes was legal, and has even shown his ignorance about how our government works to paint Hillary as incompetent because she didn t single-handedly change these laws during her time in the Senate. However, while he was busy avoiding taxes in the 1990s, his own lawyers warned him against doing, well, exactly what he did.A new report in The New York Times explains that, order to avoid total financial ruin, Trump didn t report hundreds of millions that was technically income. He didn t just not report it, though   the IRS would have seen through that immediately. Instead, his first step to avoiding taxes was successfully pushing his various bondholders to cancel the hundreds of millions he owed them.To the IRS, a dollar of canceled debt is a dollar of taxable income. That could have crippled the self-proclaimed master of debt and taxes about as badly as all that debt he couldn t pay. So what did he do? He used what s called a  stock-for-debt  swap maneuver.Except Congress banned that practice for corporations in 1993. However, Trump s real estate holdings in Atlantic City the ones that were all in trouble weren t corporations. They were partnerships. So he thought he could still swap what s called  partnership equity  for his debt.Apparently, this works even if the stocks, or, in Trump s case, the equities, are worth considerably less than the canceled debt. The Times says that this is as close as anyone can get to making taxes just magically disappear.But legally, this is fraught with its own problems and Trump s own lawyers actually warned him against doing it. He asked his tax attorneys for formal opinion letters on his plan, which all came back saying: The letters bluntly warned that there was no statute, regulation or judicial opinion that explicitly permitted Mr. Trump s tax gambit.  Due to the lack of definitive judicial or administrative authority,  his lawyers wrote,  substantial uncertainties exist with respect to many of the tax consequences of the plan.' In other words, they felt that his scheme wouldn t stand up to IRS scrutiny. We don t know if the IRS went after him for this because nobody has the whole story. However, from what we do have, tax expert and former chief tax council for the House Ways and Means Committee, John L. Buckley, was able to say: He s getting something for absolutely nothing. Buckley also said: He deducted somebody else s losses. He is double dipping big time. Buckley means that the only people who should have been able to deduct those losses were the bondholders who canceled his debts, and thus, lost out on their investments.This could be one of the bombshells he s hiding in his tax returns. Since all of this involved partnerships, profits could go straight to his personal returns, as could other items. With Trump refusing to release those, though, we don t know just how badly he stretched the law, if not broke it altogether.This scheme quite possibly laid the groundwork for his massive $916 million loss in 1995, which may have allowed him to avoid paying taxes again for 20 years. In other words, not only has he possibly sailed along while Americans who earn an honest day s pay for an honest day s work dutifully paid their taxes, but he very likely broke the law in all his machinations here in a way that the regular Americans he claims to understand would never get away with (hell, we wouldn t even know where to start, most likely).Oddly enough, using partnership equity swaps to avoid taxes was banned by Congress in 2004. Among the Senators who voted to close that loophole was Hillary Clinton.Featured image by Brian Blanco via Getty Images