Well I don't really want to write out all the code for you. But here's how I would go about it. What I would do is copy the fxDtsBrick::canCookRecipe function and name it something like, fxDtsBrick::cookRecipe and inside the for loop, instead of:
if(%this.ingredient[%ingName] < %ingAmount)
{
return false;
}
Just simply do %this.ingredient[%ingName] -= %ingAmount; We can do this since the brick has already passed the fxDtsBrick::canCookRecipe check. Then you can get the remaining amount (if any) by simply referencing the variable %this.ingredient[%ingName] inside of that for loop. From there you can determine the extra ingredients that the brick contains and add health based on that to a specified client, or whatever other variables are involved. Tell me if you understand or not :D.