Adding Capacitive touch to existing script.

Hey guys. I need to replace a push button in my current sketch with a capacitive touch switch. Im working on a gun cabinet that has capacitive touch for high voltage AC lights. These lamps display the top half of the gun cab. They are switched on by the metal door hinge (Capacitive touch). The bottom half is going to be fitted with LEDs, but I want the same trigger (door hinge) to cut the LEDS on just like the top half. So the high voltage lights and LEDs will work in sync with each other. I have the circuit working properly for the script I have written thus far.

I have very little knowledge of coding. All I do is hack at it until I get the result I want. I have downloaded the capacitive sensor library and I don't understand the example code at all. So, im taking to the forums with this one. The result needed is simply this, I need to replace the momentary push button with a metal door hinge. Side Note: This code will be uploaded to a ATtiny45. Im not sure if I have enough memory to complete this. Also I only have 2 spare I/O pins left. (3 if really needed but I kinda want the reset option)

Please excuse my lack of organization. :sweat_smile: Thanks!!!

/*
Code based off of state change code in arduino library.
Code used to dim lighting in 4 steps
 */

// this constant won't change:
const int buttonPin = 2;    // the pin that the pushbutton is attached to
const int ledPin1 =  1;       // the pin that the LED is attached to
const int ledPin2 =  0;
const int ledPin3 =  3;

// Variables will change:
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup() {
  // initialize the button pin as a input:
  pinMode(buttonPin, INPUT);
  // initialize the LEDs as an output:
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);

  
}


void loop() {
  // read the pushbutton input pin:
  buttonState = digitalRead(buttonPin);

  // compare the buttonState to its previous state
  if (buttonState != lastButtonState) {
  delay(100);
  //Cabinet lights only have 4 states, (Full Light, Dim 1, Dim 2, Off)
  //Cant exceed 4 because only 1,2, and 3 are recognized as states. 4 = off or 0
  if (buttonPushCounter >= 4) { 
      (buttonPushCounter = buttonPushCounter * 0);
    } 
    if (buttonState == HIGH) {
      // if the current state is HIGH then the button
      // went from off to on:
      (buttonPushCounter++);
      delay(100);     
     }
   
}   
  // save the current state as the last state, 
  //for next time through the loop
  lastButtonState = buttonState;

  // pin1 is Dim 2, pin2 is dim 1 and pin 3 is full brightness
  // pins control N channel Mosfets that turn on Leds with different resistance valuess
  if (buttonPushCounter == 1) {
    digitalWrite(ledPin1, HIGH);
  } else {
   digitalWrite(ledPin1, LOW);
  }
   if (buttonPushCounter == 2) {
    digitalWrite(ledPin2, HIGH);
  } else {
   digitalWrite(ledPin2, LOW);
  }
  if (buttonPushCounter == 3) {
    digitalWrite(ledPin3, HIGH);
  } else {
   digitalWrite(ledPin3, LOW);
  }
}