I now use this code to change the background alpha/color for the nameplate health and castbar:
Code:
hooksecurefunc("CompactUnitFrame_UpdateHealthColor", function(frame)
if not strfind(frame.unit, "nameplate") then return end
frame.healthBar.background:SetAlpha(0.5)
frame.healthBar.background:SetVertexColor(0,0,0)
frame.castBar.background:SetAlpha(0.5)
frame.castBar.background:SetVertexColor(0,0,0)
end)