It should be just the case of changing "Button" to "Frame". But I haven't seen this frame personally to see how it works and looks out of the box. Code wise it already handles Minimize and Maximize functionality for the parent frame it is on.
I'll see if I can rig up an addon to see what it is like to make sure this is the case.
Okay, this is a really rough addon that shows how those buttons work with minimal coding.
This is the one and only lua file for a very simple addon. The issue is that where the minmax button is linked to the frame, once you hide it you can never show it again. But, you can resize the frame to suit. Which is what I did here. However, you can't resize to smaller than the minmax button or it will disappear anyway. The X close button in my example works straight out of the box and closes the frame automatically, never to be open again until the game is restarted.
I used a different trick with my portals addon by having a *header* frame that is always displayed and had it control whether the bigger portals frame *content* was displayed or not.
Lua Code:
local displayFrame = CreateFrame("Frame",nil,nil,"BasicFrameTemplate")
displayFrame:SetSize(200,100)
displayFrame:SetPoint("CENTER")
local function OnMaximize()
displayFrame:SetSize(200,100)
end
local function OnMinimize()
displayFrame:SetSize(30,30)
end
displayFrame.MinMax = CreateFrame("Frame",nil,displayFrame, "MaximizeMinimizeButtonFrameTemplate")
displayFrame.MinMax:SetPoint("TOPRIGHT",displayFrame,0,30)
displayFrame.MinMax:SetOnMaximizedCallback(OnMaximize)
displayFrame.MinMax:SetOnMinimizedCallback(OnMinimize)
displayFrame:Show()