I tried what you wrote Treeston and it didn't work for me (frames didn't load). I do admit though I'm entirely new to LUA and what I've achieved thus far has been a mix of luck and reading. Its quite possible I did something wrong or placed it wrong.
Code:
local Castbar = CreateFrame("StatusBar", nil, self)
Castbar:SetStatusBarTexture(TEXTURE)
Castbar:SetStatusBarColor(1/6, 1/6, 2/7)
Castbar:SetSize(230, 12)
Castbar:SetPoint('TOP', self, 0, 16)
Castbar:SetPoint('LEFT', self, 0, 16)
Castbar:SetPoint('RIGHT', self, 0, 16)
Castbar:SetBackdrop(BACKDROP)
Castbar:SetBackdropColor(0, 0, 0)
local Icon = Castbar:CreateTexture(nil, "OVERLAY")
Icon:SetSize(20, 20)
Icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", 25, 0)
Icon.texture = Icon:CreateTexture("OVERLAY")
Icon.texture:SetPoint("TOPLEFT", -1, 1)
Icon.texture:SetPoint("BOTTOMRIGHT", 1, -1)
Icon.texture:SetTexture(TEXTURE)
local Time = Castbar:CreateFontString(nil, "OVERLAY")
Time:SetPoint("RIGHT", Castbar)
Time:SetFont(FONT, 8, 'OUTLINEMONOCHROME')
local Text = Castbar:CreateFontString(nil, "OVERLAY")
Text:SetPoint("LEFT", Castbar, 2, 0)
Text:SetFont(FONT, 8, 'OUTLINEMONOCHROME')
self.Castbar = Castbar
self.Castbar.bg = Background
self.Castbar.Icon = Icon
self.Castbar.Time = Time
self.Castbar.Text = Text
That is how I have it placed right now, I just copy pasted first, and it doesn't work like that. Like I said though its more then likely just me. If you wouldn't mind guiding my hand a bit.
Edit:
I got it working with a backdrop. Courtesy of Freebaser on wow-interface.
Code:
local Icon = Castbar:CreateTexture(nil, "OVERLAY")
Icon:SetSize(20, 20)
Icon:SetPoint("TOPRIGHT", self, "TOPRIGHT", 25, 0)
Icon:SetTexCoord(.1, .9, .1, .9)
local IconBackdrop = CreateFrame("Frame", nil, Castbar)
IconBackdrop:SetAllPoints(Icon)
IconBackdrop:SetFrameStrata("LOW")
IconBackdrop:SetBackdrop(BACKDROP)
IconBackdrop:SetBackdropColor(0, 0, 0)
IconBackdrop:SetBackdropBorderColor(0, 0, 0)