How to use tearDownIfPassed and tearDownIfFailed

**This answer is in reference to my question above**

The code below is what i want to achieve in Katalon studio. This is an example in c#
[TearDown]
public void TearDown()
{
if (TestContext.CurrentContext.Result.Status == TestStatus.Failed)
{
// Your test failed, handle it
}
}