Great job! I actually made a breathing script when working on water in the engine. I don't think Lee ever released it with the updates, even though he should of. If you want to take a look at it here it is:
;Artificial Intelligence Script
;Header
desc = breathing underwater
;Triggers
:state=0:dimlocalvar=breath,dimlocalvar=breathmax,setvar=breathmax 500,dimlocalvar=timerstarted,dimlocalvar=underwater,setvar=breath %breathmax
:state=0:hudreset,hudx=25,hudy=5,hudimage=languagebank\english\gamecore\huds\air.dds,hudtype=1,hudmake=display
:state=0:hudreset,hudx=24,hudy=8,hudsizex=16,hudsizey=16,hudimage=gamecore\huds\numeric1.tga,hudname=breathing,hudtype=6,huduservar=breath,hudmake=numeric,state=1
;Handle the deacrease of air
:state=1,varequal=underwater 1,vargreater=breath 1:etimerstart,setvar=underwater 2,setvar=timerstarted 0
:state=1,varequal=underwater 2,vargreater=breath 1,etimergreater=250:subvar=breath 25,etimerstart,setvar=underwater 1,setvar=timerstarted 0
;Out of air
:state=1,varequal=underwater 1,varless=breath -1:setvar=breath 0,setvar=timerstarted 0
:state=1,varequal=underwater 1,varequal=breath 0,etimergreater=1000:etimerstart,plraddhealth=-25,setvar=timerstarted 0
;Refill air
:state=1,varnotequal=breath %breathmax,varequal=underwater 0,varequal=timerstarted 0:setvar=timerstarted 1,etimerstart
:state=1,varnotequal=breath %breathmax,varequal=underwater 0,varequal=timerstarted 1,etimergreater=200:addvar=breath 35,setvar=timerstarted 0
:state=1,vargreater=breath %breathmax,varequal=underwater 0:setvar=breath %breathmax
;If the player dies reset our variables
:plralive=0:setvar=underwater 0,setvar=breath %breathmax,setvar=timerstarted 0,state=1
;Toggle our underwater variable
:plrunderwater=1,varless=underwater 0:setvar=underwater 1,stopsound
:plrunderwater=0,vargreater=underwater 1,vargreater=breath 101:setvar=underwater 0
:plrunderwater=0,vargreater=underwater 1,varless=breath 100:setvar=underwater 0,plrsound=audiobank\water\gaspforair.wav
;End of Script