My first question would be 'why'? If you use your laptop generally on mains, then doing this would mean your battery was generally either charging or discharging. Lithium Ion batteries have a limited cycle life... see http://www.newark.com/pdfs/techarticles/tektronix/LIBMG.pdf which estimates battery life to be of the order of 300 charge cycles. Depending on your laptop and usage on mains you could be running one to several charge cycles per day doing this... killing your battery. I have laptops that are many years old where the batteries still hold good charge (>50% of their original life) because they have mostly been used on mains power and the batteries have not been repeatedly cycled. I have replaced batteries for road warriors who extensively punish their laptop batteries and can kill them to less than minutes life within a couple of years use.
My second question would be 'why'? At some point you will unhook from mains to go mobile and your battery will be down around the 25% capacity mark because it's just about to start charging / just started charging. So there you have a laptop with only 1/4 of it's expected mobile usage time.
My third question would be 'why'? Laptop batteries have dedicated charging circuits that turn off the charge to the cells when they consider they are full and do 'top up' charges as necessary. Judging from the charge LED on my laptops they don't keep charging the battery when it's full. So you're wanting to control externally something the battery is already designed to do.
If you really wanted to do this, you can always 'deactivate the charge port' by unplugging the adapter and plugging it in when the battery is running low. But why would you do this?