How could I get the sum total of failed case in a test suit?

Hi guys,
I defined a global variable abc = 0, and i set a listener before every case to collect how many case runed in the test suit, the code as below:

class NewTestListener_2 {	/**	 * Executes before every test case starts.	 * @param testCaseContext related information of the executed test case.	 */	@BeforeTestCase	def sampleAfterTestCase(TestCaseContext testCaseContext) {		//int abc = 0		GlobalVariable.abc++		println (GlobalVariable.abc)		//return GlobalVariable.abc++	}}

so i can get the sum total of the case I’ve runed in the test suit, but i can’t get the sum total of failed case, i wonder know when the case failed, if Katalon possible to return anything? so that i can use the sign to collect failed case total. I used the code as below, but it doesn’t work, anyone can give me some advice? thank you very much!

class NewTestListener_3 {	/**	 * Executes after every test case ends.	 * @param testCaseContext related information of the executed test case.	 */	@AfterTestCase	def sampleAfterTestCase(TestCaseContext testCaseContext) {		if(false){			GlobalVariable.cba++			println (GlobalVariable.cba)			//return GlobalVariable.abc++		}			}}