You may try to implement the interface ITestListener, in onTestFailure() check the stack trace and call setCurrentTestResult() method to set the Skipped status.
Don't forget to make the implemented class a listener as described in '5.17 - TestNG Listeners' of TestNG documentation.